- protected fun search_down(from: N, key: K): nullable N do
- if key == from.key then return from
- if from.left != null and key < from.key then
+ # Search `key` in `from` and its children nodes.
+ protected fun search_down(from: N, key: nullable Object): nullable N do
+ if not key isa Comparable then return null
+ var cmp = key <=> from.key
+ if cmp == 0 then return from
+ if from.left != null and cmp < 0 then