| | | | | next -> |

Summary

Name/Basis Pros Cons
Full / Navigator-Based Full-featured Ordered Set API
Several kinds of iterators co-exist
Higher memory use [n pointers "wasted"]
Complex operator algorithms
External / ADT-Based Full-featured Ordered Set API
All kinds of iterators co-exist
Only way to get Levelorder
Bulky Iterators
Levelorder is forward-only
Preorder::Decrement = Postorder::Increment (and vice versa)
Threaded / Thread-Based Most memory efficient
Simpler/Faster Increment & Decrement
Can still use ADT iterators for special purposes
- set copy operations
- data save order
Tree copy is costlier than usual
- Set API is Singleton in std library

All iterator operations have amortized constant runtime

Except: destructors and copy operations for ADT-based iterators have Θ(n) runtime worst case


| next -> | Top of Page | 14. BST Iterators - 41 of 41