Question: Consider the following Doubly Linked list class and its nested Node class. Write your own Python method to create new node with element e, and

Consider the following Doubly Linked list class and its nested Node class. Write your own Python method to create new node with element e, and insert this new node after node p. You're supposed to use accessors and mutators instead of using member variables directly. Class DLL: class Node: def __init__(self, element, prev, next): self.element = element self.prev = prev self.next = next def getValue(self): return self.element def getPrev(self): return self.prev def getNext (self): return self.next def setValue(self, v): self.element = v def setPrev(self, p): self.prev = p def setNext (self, n): self.next = n Other parts of the DOL class are omitted** def insert_after(self, e, p): Your code goes here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
