Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the class specification of Unsorted Type as below: class UnsortedType Ilan array-based list . public: UnsortedType(): /I Constructor void MakeEmpty(); II Function: Returns the

image text in transcribed
image text in transcribed
image text in transcribed
Given the class specification of Unsorted Type as below: class UnsortedType Ilan array-based list . public: UnsortedType(): /I Constructor void MakeEmpty(); II Function: Returns the list to the empty state. bool IsFull() const, II Function: Determines whether list is full. int GetLength ( ) const, II Function: returns the number of elements in list. void Retrieveltem(ItemType \& item, bool\& found); /I Function: Retrieves list element whose key matches itern's key (if II present). void Insertltem(IternType item); II Function: Adds item to the end of list. void Deleteltem(ItemType item): /I Function: Deletes the element whose key matches item's key. void GetNextitem(ItemType\& item); // Function: Gets the next element in list. private: int length; // number of elements in the list ItemType info[MAX ITEMS]; // array to store the elements int currentPos; // the position of current element under consideration Assume the class Item Type is defined as class item Type \{ public: ItemType()://constructor int GetValue(); //retum value void Print()://display value void Initialize(int number), ///set value to number private: int value; //key of the item 3 ) (3pts) define(write the code for) function Insertitem(ItemType item) ) (5pts) Follow the comments to complete the client code below(i.e. fill the blanks with your code): t main() (1). I//declare an object of UnsortedType and Ilname it as myList ItemType item1; (2) Jlinsert your code here to add item1 lito the myList (3) display the length of myList (4). check the myList is full or not (5). /ldelete the item1 in myList return 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions