Question: Implement a program that creates an unsorted list by using a linked list implemented by yourself. CANNOT use LinkedList class or any other classes that

Implement a program that creates an unsorted list by using a linked list implemented by yourself. CANNOT use LinkedList class or any other classes that offers list functions. It is REQUIRED to use an ItemType class and a NodeType struct to solve this homework. You are not allowed to use Standard Template Library to create the linked list.

The data.txt file has three lines of data 100, 110, 120, 130, 140, 150, 160 100, 130, 160 1@0, 2@3, 3@END

You need to

1. Use correct Input/Output of the data file when asking user 2. create an empty unsorted list 3. add the numbers from the first line to list using putItem() function. Then print all the current keys to command line in one line using printAll(). 4. delete the numbers given by the second line in the list by using deleteItem() function. Then print all the current keys to command line in one line using printAll().. 5. putItem () the numbers in the third line of the data file to the corresponding location in the list. For example, 1@0 means adding number 1 at position 0 of the list. Then print all the current keys to command line in one line using printAll().. The following functions must be implemented and used:

1. Include the header file containing the proper functions, (e.g. UnsortedList::putItem, class ItemType, struct NodeType, etc,.) 2. putItem(parameter one is the object to be added): append the object at the end of the list. 3. putItem(parameter one is the object to be added, parameter two is the position starting from 0): insert the item at the position. 4. deleteItem(parameter is the key which is an integer): remove the item 5. getItem(parameter is an index value which starts from 0) returns the item object reference 6. printAll(parameter is the pointer that points to the beginning of the list), print all keys in order in the list.

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!