RedBlackTree.lastIter

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

Arguments

None

Return values

iterator
is a RedBlackTreeIterator pointing to the last entry. It will be an iterator with the biggest 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.lastIter.get print
Output:
{ key: 3481; value: 135; }