Question: Program needs to be in C++, please include main function and some comment lines for better understanding. DNode class that can store integer data and
Program needs to be in C++, please include main function and some comment lines for better understanding.
- DNode class that can store integer data and the address of next and prev DNode.
- Introduce a DLL (Doubly Linked List) class
- Introduce a front private data member
- Introduce a DLL constructor and destructor
- Introduce insertToFront function
- Introduce deleteFromFront function
- Introduce printAll function
- Introduce deleteLast function
- Introduce insertToMiddle function
- Introduce deleteMiddle function
- Introduce deleteLastNode function
- InsertInOrder function: insert a new node so the list reads in ascending order from the beginning to the end.
- removeOneTargetNode(int target) //remove the first target node found in the list
- removeAllTargetNodes(int target)// remove all target node(s) found in the list
- isDuplicate //return true if there is any node that are duplicate in the list. For example, 1->2->3->4 is a unique SLL. However, 1->2->3->2->1 is duplicate since 1 repeats two times and 2 repeats two times.
- Introduce a CLL (Doubly Linked List) class and all the above functions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
