Question: Objective Demonstrate an understanding of: Containers and Abstract Data Types Linked List Concepts Specification You will develop a Doubly - Linked List class based on
Objective
Demonstrate an understanding of:
Containers and Abstract Data Types
Linked List Concepts
Specification
You will develop a DoublyLinked List class based on the concepts that you have learned about linked lists. Do not inherit from the Linked List class, but feel free to duplicate any code from that class.
Start with a DLLNode class, similar to the Node class. The DLLNode class should have a self.prev attribute in addition to the attributes that a linked list node has.
Now let's work on the DoublyLinkedList class. First off, you will need to add a protected tail attribute. Your code should implement the following public methods in a class called DoublyLinkedList. Some of these will identical to the LinkedList code. Others are trivially different. Still others require quite a bit of thought to implement the self.prev attribute.
The new methods should behave in the same way that the LinkedList methods behaved. For example, removeaftercurrent should return data.
addtoheaddata
self.curr should reset to head after this action
addaftercurrentdata
removefromheaddata
self.curr should reset to head after this action
removeaftercurrent
resettohead
resettotail
moveforward
movebackward
finddata
removedata
self.curr should reset to head after this action
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
