Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Doubly-Linked 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, remove_after_current() should return data.
add_to_head(data)
self._curr should reset to head after this action
add_after_current(data)
remove_from_head(data)
self._curr should reset to head after this action
remove_after_current()
reset_to_head()
reset_to_tail()
move_forward()
move_backward()
find(data)
remove(data)
self._curr should reset to head after this action

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions