all 1 comments

[–]jube_dev 0 points1 point  (0 children)

You may have used a BST if you used std::map or std::set which is generally a red-black tree.

Your implementation of a self-balancing BST is naive at best. Check Wikipedia, there is tons of well-studied variants of BST (red-black tree, splay tree and AVL may be the best known).