rightNeighbour method

Returns the smallest value in the tree which is larger than reference.

dynamic rightNeighbour(
reference
)

Returns the smallest value in the tree which is larger than reference.

reference is either a value of type T or a function int order(T other) which returns -1, 0, or 1 depending on wether the value other in a tree node is smaller, equal, or larger as the reference point.

The standard case is to invoke it with a value of type T. The second option is useful in special usage scenarios only, see notes in the class description.

The returned value is either: