RedBlackTree.findIter

Finds an iterator by key.

Arguments

The

key
to lookup.

Return values

iterator
is a RedBlackTreeIterator pointing to the entry with the given key.
exists
is a condition, TRUE if an entry with the given key exists, FALSE otherwise.

Complexity

O(log(size))

Example

"sl/redBlackTree" useFile a: ((35 "element") (0 "ZERO") (34 "element") (-25 "element") (19 "nineteen") (481 135) (32 {a:0; b:1;})) makeRedBlackTree; 19 a.findIter [a.eraseIter] [drop] if a [print LF print TRUE] enum
Output:
{ key: -25; value: "element"; } { key: 0; value: "ZERO"; } { key: 32; value: { a:0; b: 1; }; } { key: 34; value: "element"; } { key: 35; value: "element"; } { key: 481; value: 135; }