Doubly linked list implementation in typescript.
Using npm:
npm install --save-dev @slimlib/list
No arguments. Constructs a new list object.
const list = new List;
const list = new List<NodeType>();
List provides an iterator using the [Symbol.iterator]()
method. Most commonly used in cases where another statement/method consumes an iterable object.
Array.from(list);
for (const item of list) {
// something with item
}
inserts an element after element (at the end of the list in case of list)
element - ListNode
or List
itself to add a new element after
data - object that will become a ListNode
inserts a range of elements after element (at the end of the list in case of list)
element - ListNode
or List
itself to add range after
begin - first ListNode
of a range
end - last ListNode
of a range
inserts an element before element (at the beginning of the list in case of list)
element - ListNode
or List
itself to add a new element before
data - object that will become a ListNode
inserts a range of elements before element (at the beginning of the list in case of list)
element - ListNode
or List
itself to insert range before
begin - first ListNode
of a range
end - last ListNode
of a range