Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ programming language please! Thank you! Using your knowledge of Circular and Doubly-Linked list algorithms, create a new class combining the two into a new
C++ programming language please! Thank you!
Using your knowledge of Circular and Doubly-Linked list algorithms, create a new class combining the two into a new data structure: a Circular, Doubly-Linked List. Call the class DCList and place it in it's own header file, DCList.h. Your class must implement the methods as described in the above UML diagram. The following methods should be included in your class: constructor- initializes pointers in the class to NULL. destructor- destroys the linked list. clear- destroys the linked list, resetting pointers to NULL. insert-inserts it's argument into the list, maintaining an ascending order. Returns 0 on success, -1 on failure. append- attached it's argument to the end of the list. remove- removes the first node containing it's argument from the list. Returns 0 on success, -1 on failure. isFull-returns true if the list is full, false otherwise. isEmpty - returns true if the list is empty, false otherwise. print - displays the content of the list to the screen on a single line. Each value is separated by a space reverse- displays the content of the list to the screen on a single line, but in reverse order. next-displays the "next" value in the list. It does this by advancing the cur pointer and then assigning the node's value to next's reference parameter. Returns 0 on success, -1 on failure. length-returns the number of nodes in the listStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started