hash tables can insert in O(1), but they aren't sorted.
BSTs maintain an ordering (can be traversed using pre-order traversal) but insertion is O(logN).
is there any data structure that:
- guarantees O(1) insertion
- maintains an ordering over the elements?
if not, is there a proof that such a data structure cannot exist? thanks