So far, I know that a self-balancing BST, such as the AVL tree and the Red Black Tree, can perform these operations O (log n) times.
However, to use these structures, we must implement the AVL tree or the RB tree ourselves.
I heard that there is an algorithm / implementation of these four operations without using a self-balancing BST.
With our own specific structure, we need to write so many lines. However, I heard that it is possible to support these four statements in less than 100 line code: \
Do you have any ideas on how to do this?
Besides BST, are there any other options?
source
share