TreeSet<V> constructor

TreeSet<V>({Comparator<V> comparator })

Create a new TreeSet with an ordering defined by comparator or the default (a, b) => a.compareTo(b).

Implementation

factory TreeSet({Comparator<V> comparator}) {
  comparator ??= (a, b) => (a as dynamic).compareTo(b);
  return new AvlTreeSet(comparator: comparator);
}