largest property

dynamic largest

Returns the largest value in the tree.

The returned value is either:

  • null, if this tree is empty
  • a single value of type T, if this tree doesn't support equivalence classes
  • a list of type List[T], if this tree does support equivalence classes

Implementation

dynamic get largest {
  var n = _root;
  if (n == null) return null;
  while (n!.right != null) n = n.right;
  if (this._withEquivalenceClasses) {
    return n.values;
  } else {
    return n.values.first;
  }
}