Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Doubly-Linked List . complete a part of this code ( student home work) class DLNode: # modelling a node with doubly-linked def __init__(self, inValue=None, inPrev=None,

Doubly-Linked List . complete a part of this code ( student home work)

class DLNode: # modelling a node with doubly-linked def __init__(self, inValue=None, inPrev=None, inNext=None): # constructor self.value = inValue # the node data value, default None self.prevN = inPrev # the previous node, default None self.nextN = inNext # the next node, default None

class DLList: # defining a class of Doubly-Linked List def __init__(self): # GIVEN: constructor self.headN = None # the head Node self.tailN = None # the tail Node

###################### STUDNET's WORK ###################### # simple comment HERE def insertBefore(self, refValue, newV): # insert a new node, BEFORE the ref Node (value) pass # TO BE MODIFIED AND COMPLETED # simple comment HERE def insertAfter(self, refValue, newV): # insert a new node, AFTER the ref Node (value) pass # TO BE MODIFIED AND COMPLETED

# simple comment HERE def displayDLBackw(self): print(f">>> DOUBLY-Linked-List Display, Backwards: >") pass # TO BE MODIFIED AND COMPLETED

#################

image text in transcribed

Sample console display output of executing the main testing program Aonect.py === A1C, DLList program, by === --- 1. New DLL created >>> DOUBLY-Linked-List Display: > ... AN EMPTY LIST --- 2. Insert some items --- >>> DOUBLY-Linked-List Display: > head , tail : > 11 > 22 > 33 > 55 > 77 > 99 --- 3. insertAfter(55,66) >>> DOUBLY-Linked-List Display: > ... head , tail : > 11 > 22 > 33 > 55 > 66 > 77 > 99 --- --- 4. insertBefore(55,44) >>> DOUBLY-Linked-List Display: > ... head , tail 11 > 22 > 33 > 44 > 55 > 66 > 77 > 99 --- 5. insertAfter(77,88) >>> DOUBLY-Linked-List Display: > ... head , tail : > 11 > 22 > 33 > 44 > 55 > 66 > 77 > 88 >>> DOUBLY-Linked-List Display, Backwards: > FROM ... tail 99

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_2

Step: 3

blur-text-image_3

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions