Question: C++ preferred, also can you explain your steps. It will be a great help. Thank you Exercise Summary: Implement following classes and functions (Either C
C++ preferred, also can you explain your steps. It will be a great help. Thank you
Exercise Summary: Implement following classes and functions (Either C or C++ style is fine). Please note, it is better to practice on your own first. Do not refer to any material until getting stuck. 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. g. Delete the node from the beginning. 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 deleteFromFront function similar to 2g e. Introduce printAll function similar to 2d The following 3 are harder questions. Please try them first. f. Introduce delete Last function similar to 2e g. Introduce insertToMiddle function similar to 2c h. Introduce delete Middle function similar to 2f i. Introduce delete LastNode function (If there are even number of nodes, for convenience, the left of the two nodes in the middle of SLL is your middle node)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
