TreeSet is a set of elements ordered by a comparator function. It is implemented as a sorted array.
const treeSet = new TreeSet<number>((a, b) => a - b);treeSet.setElements([1, 2, 3]);treeSet.size(); // 3 Copy
const treeSet = new TreeSet<number>((a, b) => a - b);treeSet.setElements([1, 2, 3]);treeSet.size(); // 3
Private
Readonly
Performs a binary search of value in array
Value to search in array
If value is found, returns its index in array. Otherwise, returns a negative number indicating where the value should be inserted: -(index + 1)
Generated using TypeDoc
TreeSet is a set of elements ordered by a comparator function. It is implemented as a sorted array.
Example