Question: Do not use the LinkedList class or any classes that offers list functions. Implement a LinkList in C++. The linkList should have these following methods/functions:
Do not use the LinkedList class or any classes that offers list functions. Implement a LinkList in C++.
The linkList should have these following methods/functions:
putItem(parameter one is the object to be added): append the object at the end of the list.
putItem(parameter one is the object to be added, parameter two is the position starting from 0): insert the item at the position.
deleteItem(parameter is the key which is an integer): remove the item
getItem(parameter is an index value which starts from 0) returns the item object reference
printAll(parameter is the pointer that points to the beginning of the list), print all keys in order in the list.
Pease, implement with an ItemType class and a NodeType struct
The program should read a data file, and the data file has two lines of data as follow:
100, 110, 120, 130, 140, 150, 160
100, 130, 160
The program will first use the putItem() to add all the numbers from the file to the list, and then printAll() to print all the numbers, then delete all the number in the list using deleteItem(), and then, printAll().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
