I need to write a recursive implementation of the retrieval operation for the array-based ADT list. The operation should have as parameters the array, an item, and the size of the array and return the position of the item. Since the array is being
passed as a parameter, this will be a private function in the class.
The function sould call itself with a smaller problem size.
This is the retrieval operation:
So far I came up with this....how does it look??
+retrieve ( in index:integer,
I need the class and the private funtion, but not sure where how to add it in??
void List::insert (int index, ListItemType newItem,
success = bool( (index >= 1) &&
(index <= size +1) &&
(size < MAX_LIST) );
for (int pos = size; pos >= index; --pos)
items [translate (index)] = newItem;
Thanks for the help!!