nearest method
Search the tree for the matching object
or the nearestOption
if missing. See TreeSearch.
Implementation
@override
V nearest(V object, {TreeSearch nearestOption = TreeSearch.NEAREST}) {
AvlNode<V>? found = _searchNearest(object, option: nearestOption);
if (found != null) {
return found.object;
}
throw StateError('No nearest element');
}