Question: DATA.STRUCTURES C++ Given the class specification of UnsortedType as below: class UnsortedType //an array-based list { public: UnsortedType(); // Constructor void MakeEmpty(); // Function: Returns

DATA.STRUCTURES

C++

Given the class specification of UnsortedType as below: class UnsortedType //an array-based list { public: UnsortedType(); // Constructor void MakeEmpty(); // Function: Returns the list to the empty state. bool IsFull() const; // Function: Determines whether list is full. int GetLength() const; // Function: returns the number of elements in list. void RetrieveItem(ItemType& item, bool& found); //

a) (3pts) define(write the code for) function InsertItem(ItemType item)

b) (5pts) Follow the comments to complete the client code below(i.e. fill the blanks with your code):

int main()

{

(1)___________________________//declare an object of UnsortedType and

//name it as myList

ItemType item1;

(2)___________________________//insert your code here to add item1

//to the myList

cout<

(3)___________________________// display the length of myList

(4)___________________________// check the myList is full or not

(5)___________________________//delete the item1 in myList

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!