Write a recursive array-based implementation of the retrieval operation for the ADT list given in the attached file (and copied below). The operation should take the array, an item and the size of the array as parameters and return the position of the item. Be sure that the function calls itself with a smaller problem size. //Header File const int MAX_LIST = 10; typedef int listItemType; class listClass { public: listClass(); //list operations: bool ListIsEmpty() const; int ListLength() const; void ListInsert(int NewPosition, listItemType NewItem, bool& Success); void ListDelete(int Position, bool& Success); void ListRetrieve(int Position, listItemType& DataItem, bool& Success) const; private: listItemType Items[MAX_LIST]; int Size; int Index(int Position) const; }; //CPP File #include "ListA.h" listClass::listClass() : Size(0) { } bool listClass::ListIsEmpty() const { return bool(Size == 0); } int listClass::ListLength() const { return Size; } void listClass::ListInsert(int NewPosition, listItemType NewItem, bool& Success) { Success = bool( (NewPosition >= 1) && (NewPosition <= Size+1) && (Size < MAX_LIST)); if (Success) { for (int Position = Size; Position >= NewPosition; --Position) { Items[Index(Position+1)] = Items[Index(Position)]; } Items[Index(NewPosition)] = NewItem; ++Size; } } void listClass::ListDelete(int Position, bool& Success) { Success = bool((Position >= 1) && (Position <= Size)); if (Success) { for (int FromPosition = Position+1; FromPosition <= Size; ++FromPosition) { Items[Index(FromPosition-1)] = Items[Index(FromPosition)]; } --Size; } } void listClass::ListRetrieve(int Position, listItemType& DataItem, bool& Success) const { Success = bool((Position >= 1) && (Position <= Size)); if (Success) { DataItem = Items[Index(Position)]; } } int listClass::Index(int Position) const { return Position-1; }
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Complete ownership and distribution copyrights to all work purchased.
## Platform
Windows