Module pythonnds.linkedlist

Linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence.

Classes

class Node (value: ~T)
class SinglyLinkedList

Methods

def add(self, value: ~T) ‑> NoneType

Add element to linked list.

def getHead(self) ‑> ~T

Get value of the linkedlist head node.

def getHeadNode(self) ‑> Node

Get head node referance.

def getSize(self) ‑> int

Return size of the linkedlist.

def isEmpty(self) ‑> bool

Checks if linkedlist is empty.

def remove(self)

Remove node from linkedlist.

def toArray(self) ‑> list

Converts linkedlist to list.