trees :: BinTreeMap :: max
O(n) in worst case, average is O(h) with h: tree height
var tree = new BinTreeMap[Int, String]
for i in [4, 2, 1, 5, 3, 6, 7, 8] do tree[i] = "n{i}"
assert tree.max == "n8"
# Get the node with the maximum key
# O(n) in worst case, average is O(h) with h: tree height
#
# var tree = new BinTreeMap[Int, String]
# for i in [4, 2, 1, 5, 3, 6, 7, 8] do tree[i] = "n{i}"
# assert tree.max == "n8"
fun max: E do
assert not_empty: root != null
return max_from(root.as(not null)).value
end
lib/trees/bintree.nit:127,2--136,4