Question: Implement following classes and functions (C++ style). 1. Node class that can store integer data and the address of next Node. 2. Introduce at least
Implement following classes and functions (C++ style).
1. Node class that can store integer data and the address of next Node.
2. Introduce at least 5 nodes in main function, then program 2a-2f in main function.
a. Connect them together.
b. Introduce a node and insert it before the first node of the 5 nodes
c. Introduce a node and insert it in the middle of the 5 nodes
d. Traverse the 5 nodes and print all elements out
e. Traverse to the end of 5 nodes and delete the last node
f. Traverse to the middle of 5 nodes and delete the middle node.
3. Introduce a SLL (Singly Linked List) class (home practice if no time)
a. Introduce a front private data member
b. Introduce a SLL constructor and destructor
c. Introduce insertToFront function similar to 2b
d. Introduce insertToMiddle function similar to 2c
e. Introduce printAll function similar to 2d
f. Introduce deleteLast function similar to 2e
g. Introduce deleteMiddle function similar to 2f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
