Module pythonnds.doublylinkedlist
Doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains three fields: two link fields and one data field.
Classes
class DoublyLinkedList
-
Methods
def addAtHead(self, value: ~T) ‑> NoneType
-
Add node at head end.
def addAtTail(self, value: ~T) ‑> NoneType
-
Add node at tail end.
def getHead(self)
-
Get value at the front end of the list.
def getSize(self) ‑> int
-
Get length of the linked list.
def getTail(self) ‑> ~T
-
Get value at the tail of the list.
def isEmpty(self) ‑> bool
-
Check if linkedlist is empty
def removeAtHead(self)
-
Remove node at head end.
def removeAtTail(self)
-
Remove node at tail end.
class Node (value: ~T)