Iterator.prev
Returns an iterator pointing to the previous entry.
Arguments
None
Return values
iterator
pointing to the previous entry.
Complexity
Constant. Amortized constant and Log(size) in the worst case for RedBlackTreeIterator.
Example
"sl/array" useFile
"sl/linkedList" useFile
"sl/hashTable" useFile
"sl/redBlackTree" useFile
a: (1 2 3) makeArray;
l: (4 5 6) makeList;
ht: ((1 "ONE") (2 "TWO") (3 "THREE")) makeHashTable;
rb: ((4 "FOUR") (5 "FIVE") (6 "SIX")) makeRedBlackTree;
a.endIter.prev.get print LF print
l.endIter.prev.get print LF print
ht.endIter.prev.get print LF print
rb.endIter.prev.get print
Output:
3
6
{ key: 3; value: "THREE"; }
{ key: 6; value: "SIX"; }