by wpears · 11y ago · 0 comments
BSTs are O(n) lookup, and the pathological case is quite easy to achieve: add elements to it in sorted order.
There are other trees that have O(lg n) lookup. Red-black trees are the canonical example.