RedBlackTree.find

Finds an entry by key.

Arguments

The

key
to lookup.

Return values

value
found by the key, empty if the key is not found.
exists
is a condition, TRUE if an entry with the given key exists, FALSE otherwise.

Complexity

O(log(size))

Example

"sl/redBlackTree" useFile a: RedBlackTree; 35 "element" a.insert 0 "ZERO" a.insert 34 "element" a.insert -25 "element" a.insert 19 "nineteen" a.insert 3481 135 a.insert 32 { a:0; b:1; } a.insert 19 a.find [ print ] [ drop "NO" print ] if
Output:
nineteen