The type this tree holds. It must be opaque for the actual tree implementation.
An iterator through the tree, conforming to TreeIterator
's requirements.
This method should return an empty iterator, i.e. one pointing before the lowest item in the tree.
Examples:
// Initially an empty iterator:
const iterator = Tree([1, 2, 3]).iterator();
iterator.data === null; // -> true
// Now, moving down one element, cycling the tree around:
iterator.prev() === 3; // -> true
// Now, if we check the data again:
iterator.data === 3; // -> true
Return the node equal or immediately after item
.
Examples:
Tree([1, 3, 5]).lowerBound(3) -> 3
Tree([1, 3, 5]).lowerBound(4) -> 5
The value to search by.
An iterator with data
pointing at the desired node, an empty iterator otherwise (see TreeIterator
).
Return the node immediately after item
.
Examples:
Tree([1, 3, 5]).upperBound(3) -> 5
Tree([1, 3, 5]).upperBound(4) -> 5
The value to search by.
An iterator with data
pointing at the desired node, an empty iterator otherwise (see TreeIterator
).
Generated using TypeDoc
A plug-in interface for custom tree implementations.