@datastructures-js/linked-list
Advanced tools
Changelog
[5.2.0] - 2022-02-14
.find
now accepts a second param as the starting node in both types..findReverse
added to DoublyLinkedList..fromArray
static method added to both types.Changelog
[5.0.0] - 2021-04-12
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.Changelog
[4.0.0] - 2021-02-16
.removeFirst()
, .removeLast()
, .removeAt
, .removeEach
now return the removed nodes.Changelog
[3.0.3] - 2021-01-30
.removeFirst()
when removing first from a single-node linked list.Changelog
[3.0.0] - 2020-12-30
.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.