@reza2022/linked-list
v1.5.5
Published
make a linked list using this package
Downloads
2
Readme
Linked List
Doubly Linked List implemented with JavaScript
Features
append(value)
gets a value and creates a new Node with the given value and appeands the node to end of the listprepend(value)
gets a value and creates a new Node and appeands it to the start of listsize()
returns a number that is the length of the list. starting at index 1head()
returns the first node in the listtail()
returns the last node in the listat(index)
gets an index and returns the value of the given index inside the list. returns an error if index is not correctpop()
removes the last element from the listcontains(value)
gets a value and returns true if the value is found inside the list. returns false if value is not foundfind(value)
gets a value and returns the node of the given value, returns null if the value is not foundtoString()
console.log's the entire list one by oneinsertAt(value, index)
gets a value and an index and creates a new Node with the given value and insrets the Node at the given indexremoveAt(index)
gets an index and removes the Node inside the list at the given index