Helps you with different kinds of Linked Lists
The list module helps to implement Linked Lists. As of now, list module only helps to implenent Singly-Linked_list and it also provides a class for nodes in the Linked List.
The list module defines the following class (more classes to be added later):
Constructor for a Singly Linked List. It will create a new Linked List instance on which we can perform different class methods as mentioned below:
from list import Singly_linked_list list = Singly_linked_list()
list object (Singly_linked_list) provides the following public methods described below:
Inserts a new node at the end of the Linked List. You need to provide the value/data (which is given as 'val' in the Node class) of the node as an argument.
Removes the last (tail) node from the Linked list and return its value.
Removes the first (head) node from the Linked list and return its value.
Inserts a new node at the beginning of the Linked List. You need to provide the value (which is given as 'val' in the Node class) of the node as an argument.
Gets the value of the node at a particular position/index (passed as argument).
Replaces the value of a node at a particular position/index with the new value (passed as argument).
Inserts a new node at a particular position in the Linked List. Provide position and the value/data as argument.
Removes a node from a given position (provided as argument).
Reverses the Linked List.
Returns the value of the 'head' node.
Returns the value of the 'tail' node.
Prints the whole Linked List.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for linked_lists_sd-0.0.1-py3-none-any.whl