Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Doubly Linked Lists question Interface Requirements 1.1 DLNode Your code should contain definitions for a class DLNode which will be a doubly-linked container node, and
Doubly Linked Lists question
Interface Requirements 1.1 DLNode Your code should contain definitions for a class DLNode which will be a doubly-linked container node, and a class DLList which will be the linked list of DLNode s. It is recommended that your linked list utilize both a head and tail pointer 1.2 DLList 12.1 EmptyListException 2 Files to Submit DLNode The DLNode will serve as a doubly-linked container for data of string Your DLNode should provide (at a minimum) the following public interface: Constructor You should provide a constructor that will take a data value and store it in the node. It should also set all the node's pointers to nullptr get data method returns the data value for the node get next method returns the node's next pointer (the pointer to the next node in the list) get prev method returns the node's prev pointer (the pointer to the previous node in the list). set_data method takes a data value as a parameter and uses it to set the node's data value set next method takes a pont o a DLNode as a parameter and uses it to set the node's next pointer set prev method takes a pointer to a DINode as a parameter and uses it to set the node's prev pointer. Implement this in "DLNode.h" and "DLNode.cpp" DLList The DLList will manage a doubly-linked list built from DLNode s. Internally, you will need storage for pointers to the head (and probably tai) of the list, as well as an integer to store the count of the number of items currently in the list. The list will throw an exception on any attempt to remove or read from an empty list. Your DLList should provide (at a minimum) the following public interface: Constructors You should provide a default constructor that initializes the list's pointers to nullptr. You should provide a copy constructor that will allow copying one list into the new list. (You might want to make use of the assignment operator for the copy constructor.) Destructor You should provide a destructor that will de-allocate all of the nodes in the list add front methood takes a data value as a parameter, and inserts that value at the beginning (head) of the list add back method takes a data value as a parameter, and inserts that value at the end (tail) of the list. Interface Requirements 1.1 DLNode Your code should contain definitions for a class DLNode which will be a doubly-linked container node, and a class DLList which will be the linked list of DLNode s. It is recommended that your linked list utilize both a head and tail pointer 1.2 DLList 12.1 EmptyListException 2 Files to Submit DLNode The DLNode will serve as a doubly-linked container for data of string Your DLNode should provide (at a minimum) the following public interface: Constructor You should provide a constructor that will take a data value and store it in the node. It should also set all the node's pointers to nullptr get data method returns the data value for the node get next method returns the node's next pointer (the pointer to the next node in the list) get prev method returns the node's prev pointer (the pointer to the previous node in the list). set_data method takes a data value as a parameter and uses it to set the node's data value set next method takes a pont o a DLNode as a parameter and uses it to set the node's next pointer set prev method takes a pointer to a DINode as a parameter and uses it to set the node's prev pointer. Implement this in "DLNode.h" and "DLNode.cpp" DLList The DLList will manage a doubly-linked list built from DLNode s. Internally, you will need storage for pointers to the head (and probably tai) of the list, as well as an integer to store the count of the number of items currently in the list. The list will throw an exception on any attempt to remove or read from an empty list. Your DLList should provide (at a minimum) the following public interface: Constructors You should provide a default constructor that initializes the list's pointers to nullptr. You should provide a copy constructor that will allow copying one list into the new list. (You might want to make use of the assignment operator for the copy constructor.) Destructor You should provide a destructor that will de-allocate all of the nodes in the list add front methood takes a data value as a parameter, and inserts that value at the beginning (head) of the list add back method takes a data value as a parameter, and inserts that value at the end (tail) of 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