RedBlackTree.firstIter

Returns an iterator pointing to the first entry of the tree.

Arguments

None

Return values

iterator
is a RedBlackTreeIterator pointing to the first entry. It will be an iterator with the smallest key because a tree is always sorted. If the tree is empty, an “end” iterator is returned.

Complexity

Constant

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 a.firstIter.get print
Output:
{ key: -25; value: "element"; }