Skip to main content

Linked List

Create a singly Linked List.


import { LinkedList } from 'athro';

let list = new LinkedList();

Available Methods

Methods available for the Linked List.

pushAdd item to the end of the LLlist.push(value)
popRemove item from the end of the LLlist.pop()
unshiftAdd an item to the front of the LLlist.unshift(value)
shiftRemove an item from the front of the LLlist.shift()
getGet a node from the LLlist.get(index)
setSet value for an existing node in the LLlist.set(index, value)
insertInsert a value at a specific index in the LLlist.insert(index, value)
removeRemove an item from specific position of the LLlist.remove(index)
reverseReverse the LLlist.reverse()
traverseTraverse and print the LLlist.traverse()