Not sure if I am on the right track with the code below. This is what I need, I know I am missing stuff, just not sure how to put it in here!
Write a recursive implementation, 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.
Thanks for everybodies help!!!! You have all been great!
Code:
list::() :size = (0) //would this be the array? where does the //private function go?
void List::insert (int index, ListItemType newItem,
bool& success)
{
success = bool( (index >= 1) &&
(index <= size +1) &&
(size < MAX_LIST) );
if (success)
{
items[translate(index)]=newitem;
++size;
insert(index+1,newitem,success);
}
}