@datastrucures-js/linked-list
Docs
Linked List
https://datastructures-js.info/docs/linked-list
a javascript implementation of LinkedList & DoublyLinkedList
https://datastructures-js.info/docs/linked-list
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
removeEach edge case to disconnect removed nodes from the remaining nodes in the list.toArray fix ts return type.insertBefore to add a node before an existing node in the DoublyLinkedList.insertAfter to add a node after an existing node in the DoublyLinkedList.removeEach..find now accepts a second param as the starting node in both types..findReverse added to DoublyLinkedList..fromArray static method added to both types.insertLast in LinkedList now accepts a starting node as a second param, useful to insert a node at the end in O(1) runtime.removeEach now returns the number of removed nodes.remove(node) to DoublyLinkedList to remove any node in O(1) runtime.hasNext/hasPrev cleaner checks of connected nodes to Node classes..removeFirst(), .removeLast(), .removeAt, .removeEach now return the removed nodes..removeFirst() when removing first from a single-node linked list..insertAt(position, value) position now comes first then value..insert* methods now returns a this reference so it can be chained..forEach(cb) callback now gets called with node and position (starting from 0);.forEachReverse(cb) callback now gets called with node and position (starting from size -1);LinkedListNode & DoublyLinkedListNode classes are now exported in index..isEmpty() method for LinkedList & DoublyLinkedList.