TreeSet
Defined in: src/set/TreeSet.ts:21
A sorted NavigableSet backed by a TreeMap (a red-black tree). Elements are ordered by the comparator
given to the constructor, or naturally (numbers, strings, bigints, booleans, Dates, objects with compareTo) when
there is none; the ordering, not equals(), decides which elements are equal.
add, remove, contains and the navigation methods (floor, ceiling, higher, lower) run in O(log n);
iteration is in ascending order. Under natural ordering null/undefined elements throw
NullPointerException and elements of mixed types throw ClassCastException. Range and descending
views are live; iterators are fail-fast. It shares its key-set machinery with TreeMap.navigableKeySet().
Extends
Section titled “Extends”NavigableKeySet<E>
Type Parameters
Section titled “Type Parameters”E
Implements
Section titled “Implements”NavigableSet<E>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TreeSet<
E>(source?):TreeSet<E>
Defined in: src/set/TreeSet.ts:31
Creates an empty set, an empty set ordered by a comparator, or a copy of a collection. With no argument (or
null) elements are ordered naturally. Copying a sorted set (a Set with a comparator() method) keeps
the source’s comparator and order; any other collection is ordered naturally. The type system cannot tell the two
source kinds apart, so the choice is made at run time.
Parameters
Section titled “Parameters”source?
Section titled “source?”Collection<E> | Comparator<E> | null
a comparator, a collection to copy, or nothing for natural ordering
Returns
Section titled “Returns”TreeSet<E>
Throws
Section titled “Throws”IllegalArgumentException if source is neither a comparator nor a collection
Throws
Section titled “Throws”NullPointerException / ClassCastException if a copied element cannot be compared
Overrides
Section titled “Overrides”NavigableKeySet<E>.constructor
Accessors
Section titled “Accessors”[SET_BRAND]
Section titled “[SET_BRAND]”Get Signature
Section titled “Get Signature”get [SET_BRAND]():
true
Defined in: src/abstract/AbstractSet.ts:24
Runtime brand that marks this object as a Set (TypeScript interfaces do not exist at runtime); always true.
Returns
Section titled “Returns”true
Inherited from
Section titled “Inherited from”NavigableKeySet.[SET_BRAND]
Methods
Section titled “Methods”[INSPECT]()
Section titled “[INSPECT]()”[INSPECT]():
string
Defined in: src/abstract/AbstractCollection.ts:195
Node’s util.inspect hook: console.log prints the toString() form.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”NavigableKeySet.[INSPECT]
[iterator]()
Section titled “[iterator]()”[iterator]():
IterableIterator<E>
Defined in: src/map/TreeMap.ts:1779
Returns a fail-fast iterator over the elements in ascending order.
Returns
Section titled “Returns”IterableIterator<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.[iterator]
add(
e):boolean
Defined in: src/map/TreeMap.ts:1813
Adds e if no element that compares equal is present. O(log n).
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”boolean
true if the set changed
Throws
Section titled “Throws”UnsupportedOperationException on a key-set view of a map
Throws
Section titled “Throws”NullPointerException if e is null or undefined under natural ordering
Throws
Section titled “Throws”ClassCastException if e cannot be compared with the elements in this set
Throws
Section titled “Throws”IllegalArgumentException if e is outside the range of a range view
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.add
addAll()
Section titled “addAll()”addAll(
c):boolean
Defined in: src/abstract/AbstractCollection.ts:96
Calls add for each element of a snapshot of c (so addAll(this) terminates); returns true if any call
changed the collection.
Parameters
Section titled “Parameters”Collection<E>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Throws
Section titled “Throws”UnsupportedOperationException if add is not supported and c is not empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.addAll
addFirst()
Section titled “addFirst()”addFirst(
_e):void
Defined in: src/map/TreeMap.ts:1879
Not supported: the ordering decides positions.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”void
Throws
Section titled “Throws”UnsupportedOperationException always
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.addFirst
addLast()
Section titled “addLast()”addLast(
_e):void
Defined in: src/map/TreeMap.ts:1886
Not supported: the ordering decides positions.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”void
Throws
Section titled “Throws”UnsupportedOperationException always
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.addLast
ceiling()
Section titled “ceiling()”ceiling(
e):E|null
Defined in: src/map/TreeMap.ts:1910
Returns the least element greater than or equal to e, or null if there is none. O(log n).
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”E | null
Throws
Section titled “Throws”NullPointerException if e is null or undefined under natural ordering and this set is not
empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.ceiling
clear()
Section titled “clear()”clear():
void
Defined in: src/map/TreeMap.ts:1826
Removes all elements (for a range view, every element in its range).
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.clear
clone()
Section titled “clone()”clone():
TreeSet<E>
Defined in: src/set/TreeSet.ts:45
Shallow copy of the same runtime class (subclass fields included) with the same comparator.
Returns
Section titled “Returns”TreeSet<E>
comparator()
Section titled “comparator()”comparator():
Comparator<E> |null
Defined in: src/map/TreeMap.ts:1830
Returns the comparator that orders this set, or null when it uses natural ordering.
Returns
Section titled “Returns”Comparator<E> | null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.comparator
contains()
Section titled “contains()”contains(
o):boolean
Defined in: src/map/TreeMap.ts:1802
Returns true if this set contains an element that compares equal to o. O(log n); the ordering, not equals(),
decides equality.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if o is null or undefined under natural ordering
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.contains
containsAll()
Section titled “containsAll()”containsAll(
c):boolean
Defined in: src/abstract/AbstractCollection.ts:83
Returns true if this collection contains every element of c (calls contains for each).
Parameters
Section titled “Parameters”Collection<unknown>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.containsAll
descendingIterator()
Section titled “descendingIterator()”descendingIterator():
Iterator<E>
Defined in: src/map/TreeMap.ts:1783
Returns a fail-fast iterator over the elements in descending order.
Returns
Section titled “Returns”Iterator<E>
Implementation of
Section titled “Implementation of”NavigableSet.descendingIterator
Inherited from
Section titled “Inherited from”NavigableKeySet.descendingIterator
descendingSet()
Section titled “descendingSet()”descendingSet():
NavigableSet<E>
Defined in: src/map/TreeMap.ts:1935
Returns a live view of this set in descending order: changes through either side are visible in the other.
Returns
Section titled “Returns”NavigableSet<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.descendingSet
equals()
Section titled “equals()”equals(
o):boolean
Defined in: src/abstract/AbstractSet.ts:37
Returns true if o is a Set of the same size that this set containsAll of; any Set implementation
compares. A ClassCastException or NullPointerException from containsAll counts as “not equal”.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.equals
first()
Section titled “first()”first():
E
Defined in: src/map/TreeMap.ts:1837
Returns the lowest element.
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if this set is empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.first
floor()
Section titled “floor()”floor(
e):E|null
Defined in: src/map/TreeMap.ts:1902
Returns the greatest element less than or equal to e, or null if there is none. O(log n).
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”E | null
Throws
Section titled “Throws”NullPointerException if e is null or undefined under natural ordering and this set is not
empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.floor
forEach()
Section titled “forEach()”forEach(
action):void
Defined in: src/abstract/AbstractCollection.ts:157
Calls action for each element in iteration order.
Parameters
Section titled “Parameters”action
Section titled “action”(e) => void
Returns
Section titled “Returns”void
Throws
Section titled “Throws”NullPointerException if action is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.forEach
getFirst()
Section titled “getFirst()”getFirst():
E
Defined in: src/map/TreeMap.ts:1851
Returns the first (lowest) element; same as first().
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if this set is empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.getFirst
getLast()
Section titled “getLast()”getLast():
E
Defined in: src/map/TreeMap.ts:1858
Returns the last (highest) element; same as last().
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if this set is empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.getLast
hashCode()
Section titled “hashCode()”hashCode():
number
Defined in: src/abstract/AbstractSet.ts:81
Returns the sum of the element hashes (32-bit), so equal sets hash the same whatever their order.
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.hashCode
headSet()
Section titled “headSet()”Call Signature
Section titled “Call Signature”headSet(
toElement):SortedSet<E>
Defined in: src/map/TreeMap.ts:1948
Returns a live view of the elements strictly less than toElement; same as headSet(toElement, false). O(1) to
create; adding an element outside the range through the view throws IllegalArgumentException.
Parameters
Section titled “Parameters”toElement
Section titled “toElement”E
Returns
Section titled “Returns”SortedSet<E>
Throws
Section titled “Throws”NullPointerException if toElement is null or undefined under natural ordering
Throws
Section titled “Throws”IllegalArgumentException if this set is itself a range view and toElement is outside its range
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.headSet
Call Signature
Section titled “Call Signature”headSet(
toElement,inclusive):NavigableSet<E>
Defined in: src/map/TreeMap.ts:1954
Returns a live view of the elements less than (or, if inclusive, equal to) toElement. O(1) to create.
Parameters
Section titled “Parameters”toElement
Section titled “toElement”E
inclusive
Section titled “inclusive”boolean
Returns
Section titled “Returns”NavigableSet<E>
Throws
Section titled “Throws”NullPointerException if toElement is null or undefined under natural ordering
Throws
Section titled “Throws”IllegalArgumentException if this set is itself a range view and toElement is outside its range
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.headSet
higher()
Section titled “higher()”higher(
e):E|null
Defined in: src/map/TreeMap.ts:1918
Returns the least element strictly greater than e, or null if there is none. O(log n).
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”E | null
Throws
Section titled “Throws”NullPointerException if e is null or undefined under natural ordering and this set is not
empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.higher
isEmpty()
Section titled “isEmpty()”isEmpty():
boolean
Defined in: src/map/TreeMap.ts:1794
Returns true if this set has no elements. O(1) for a whole set; O(log n) for a range view.
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.isEmpty
iterator()
Section titled “iterator()”iterator():
Iterator<E>
Defined in: src/map/TreeMap.ts:1759
Returns a fail-fast iterator over the elements in ascending order; O(1) amortized per step. Its remove writes
through.
Returns
Section titled “Returns”Iterator<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.iterator
last()
Section titled “last()”last():
E
Defined in: src/map/TreeMap.ts:1844
Returns the highest element.
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if this set is empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.last
lower()
Section titled “lower()”lower(
e):E|null
Defined in: src/map/TreeMap.ts:1894
Returns the greatest element strictly less than e, or null if there is none. O(log n).
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”E | null
Throws
Section titled “Throws”NullPointerException if e is null or undefined under natural ordering and this set is not
empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.lower
parallelStream()
Section titled “parallelStream()”parallelStream():
Stream<E>
Defined in: src/abstract/AbstractCollection.ts:180
Returns a stream over spliterator() flagged as parallel.
Returns
Section titled “Returns”Stream<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.parallelStream
pollFirst()
Section titled “pollFirst()”pollFirst():
E|null
Defined in: src/map/TreeMap.ts:1922
Removes and returns the lowest element, or null if this set is empty. O(log n).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.pollFirst
pollLast()
Section titled “pollLast()”pollLast():
E|null
Defined in: src/map/TreeMap.ts:1927
Removes and returns the highest element, or null if this set is empty. O(log n).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.pollLast
remove()
Section titled “remove()”remove(
o):boolean
Defined in: src/map/TreeMap.ts:1822
Removes the element that compares equal to o, if present. O(log n).
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
true if an element was removed
Throws
Section titled “Throws”NullPointerException if o is null or undefined under natural ordering
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.remove
removeAll()
Section titled “removeAll()”removeAll(
c):boolean
Defined in: src/abstract/AbstractSet.ts:56
Removes every element also in c. Walks the smaller side, sized by size(): when this set is larger, iterates c and calls this.remove(e) for each element (so this set’s equality decides, and remove(null) may throw NullPointerException); otherwise iterates this set, removing (iterator.remove, via removeIf) each element c.contains().
Parameters
Section titled “Parameters”Collection<unknown>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null, or this set contains null and c does not permit null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.removeAll
removeFirst()
Section titled “removeFirst()”removeFirst():
E
Defined in: src/map/TreeMap.ts:1865
Removes and returns the lowest element. O(log n).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if this set is empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.removeFirst
removeIf()
Section titled “removeIf()”removeIf(
filter):boolean
Defined in: src/abstract/AbstractCollection.ts:128
Removes every element for which filter returns true, through the iterator’s remove(); returns true if
any was removed.
Parameters
Section titled “Parameters”filter
Section titled “filter”(e) => boolean
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if filter is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.removeIf
removeLast()
Section titled “removeLast()”removeLast():
E
Defined in: src/map/TreeMap.ts:1872
Removes and returns the highest element. O(log n).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if this set is empty
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.removeLast
retainAll()
Section titled “retainAll()”retainAll(
c):boolean
Defined in: src/abstract/AbstractCollection.ts:118
Removes every element that c does not contain, through the iterator’s remove(); returns true if any was
removed.
Parameters
Section titled “Parameters”Collection<unknown>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.retainAll
reversed()
Section titled “reversed()”reversed():
NavigableSet<E>
Defined in: src/map/TreeMap.ts:1939
Returns a live descending view; same as descendingSet().
Returns
Section titled “Returns”NavigableSet<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.reversed
size()
Section titled “size()”size():
number
Defined in: src/map/TreeMap.ts:1790
Returns the number of elements. O(1) for a whole set or its descending view; a range view counts its elements, O(k).
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.size
spliterator()
Section titled “spliterator()”spliterator():
Spliterator<E>
Defined in: src/map/TreeMap.ts:1768
Returns a spliterator over the elements, used to build streams; late-binding and fail-fast. TreeMap keys: SIZED (until split)|DISTINCT|SORTED|ORDERED, getComparator() = comparator(); full descending view: SIZED (until split)|DISTINCT|ORDERED; ascending range: DISTINCT|SORTED|ORDERED, descending range: DISTINCT|ORDERED, both of unknown size. Late-binding and fail-fast.
Returns
Section titled “Returns”Spliterator<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.spliterator
stream()
Section titled “stream()”stream():
Stream<E>
Defined in: src/abstract/AbstractCollection.ts:175
Returns a sequential stream over spliterator().
Returns
Section titled “Returns”Stream<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.stream
subSet()
Section titled “subSet()”Call Signature
Section titled “Call Signature”subSet(
fromElement,toElement):SortedSet<E>
Defined in: src/map/TreeMap.ts:1981
Returns a live view of the elements from fromElement (inclusive) to toElement (exclusive); same as
subSet(fromElement, true, toElement, false). O(1) to create.
Parameters
Section titled “Parameters”fromElement
Section titled “fromElement”E
toElement
Section titled “toElement”E
Returns
Section titled “Returns”SortedSet<E>
Throws
Section titled “Throws”IllegalArgumentException if fromElement is greater than toElement, or either is outside this
view’s range
Throws
Section titled “Throws”NullPointerException if either bound is null or undefined under natural ordering
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.subSet
Call Signature
Section titled “Call Signature”subSet(
fromElement,fromInclusive,toElement,toInclusive):NavigableSet<E>
Defined in: src/map/TreeMap.ts:1989
Returns a live view of the elements between fromElement and toElement, each end included when its flag is set.
O(1) to create.
Parameters
Section titled “Parameters”fromElement
Section titled “fromElement”E
fromInclusive
Section titled “fromInclusive”boolean
toElement
Section titled “toElement”E
toInclusive
Section titled “toInclusive”boolean
Returns
Section titled “Returns”NavigableSet<E>
Throws
Section titled “Throws”IllegalArgumentException if fromElement is greater than toElement, or either is outside this
view’s range
Throws
Section titled “Throws”NullPointerException if either bound is null or undefined under natural ordering
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.subSet
tailSet()
Section titled “tailSet()”Call Signature
Section titled “Call Signature”tailSet(
fromElement):SortedSet<E>
Defined in: src/map/TreeMap.ts:1964
Returns a live view of the elements greater than or equal to fromElement; same as tailSet(fromElement, true).
O(1) to create; adding an element outside the range through the view throws IllegalArgumentException.
Parameters
Section titled “Parameters”fromElement
Section titled “fromElement”E
Returns
Section titled “Returns”SortedSet<E>
Throws
Section titled “Throws”NullPointerException if fromElement is null or undefined under natural ordering
Throws
Section titled “Throws”IllegalArgumentException if this set is itself a range view and fromElement is outside its range
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.tailSet
Call Signature
Section titled “Call Signature”tailSet(
fromElement,inclusive):NavigableSet<E>
Defined in: src/map/TreeMap.ts:1970
Returns a live view of the elements greater than (or, if inclusive, equal to) fromElement. O(1) to create.
Parameters
Section titled “Parameters”fromElement
Section titled “fromElement”E
inclusive
Section titled “inclusive”boolean
Returns
Section titled “Returns”NavigableSet<E>
Throws
Section titled “Throws”NullPointerException if fromElement is null or undefined under natural ordering
Throws
Section titled “Throws”IllegalArgumentException if this set is itself a range view and fromElement is outside its range
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.tailSet
toArray()
Section titled “toArray()”Call Signature
Section titled “Call Signature”toArray():
E[]
Defined in: src/abstract/AbstractCollection.ts:41
Returns a new array of the elements in iteration order.
Returns
Section titled “Returns”E[]
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.toArray
Call Signature
Section titled “Call Signature”toArray<
A>(generator):A
Defined in: src/abstract/AbstractCollection.ts:48
Copies the elements in iteration order into generator(size()) and returns that array.
Type Parameters
Section titled “Type Parameters”A extends WritableArrayLike<E>
Parameters
Section titled “Parameters”generator
Section titled “generator”(length) => A
receives the element count and returns a plain or typed array of at least that length
Returns
Section titled “Returns”A
Throws
Section titled “Throws”IndexOutOfBoundsException if the generated typed array is too short
Throws
Section titled “Throws”NullPointerException if generator or its result is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.toArray
toString()
Section titled “toString()”toString():
string
Defined in: src/abstract/AbstractCollection.ts:199
Returns [e1, e2, ...] in iteration order; an element that is this collection prints as (this Collection).
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”NavigableKeySet.toString
staticof<E>(…elements):TreeSet<E>
Defined in: src/set/TreeSet.ts:38
Returns a new naturally ordered set of the given elements; duplicates are dropped.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”elements
Section titled “elements”…E[]
Returns
Section titled “Returns”TreeSet<E>