Implement a Double linked List ADT to store a collection of integers. The ADT wi
ID: 3801908 • Letter: I
Question
Implement a Double linked List ADT to store a collection of integers.
The ADT will include the following member functions:
--- a default constructor
--- the "big-3": destructor, copy constructor and overloaded assignment operator
1. a member function InsertFront(int data) that inserts a number at the front of the list
2. a member function append(int data) that appends a number at the back of the list
3. a member function popFirst() that removes first element of the list.
4. a member function popLast() that removes last element of the list.
6. a member function that deletes a number and all its copies from the list, where these copies can be located anywhere in the list.
7. a member function MtoLastElement(int M) that returns Mth to the last element of a list such that when M = 0, the last element of the list is returned.
8. a member function that returns the size of the list.
9. an overloaded put operator (<<) to print out all the data items stored on a linked list. Note that you are recommended to overload this operator as a friend function of the List class.
10. a member function that reverses a linked list without recreating a temporary copy of this linked list. In other words, your function CAN NOT use the 'new' operator. Here is an example, if a list contains the following data items, 3 -> 5 -> 1 -> 7; this reverse() function will change the list to 7 -> 1 -> 5 -> 3.
Explanation / Answer
Here is the code for above scenario, not exact , but will help for reference:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.