Best Data Structure/Algorithm for insert/delete/rank/select queries
So far, I know that self-balancing BST like AVL tree and Red Black Tree can do these operations in O(log n) times. However, to use these structures, we must implement AVL tree or RB tree ourselves. I have heard that there is an algorithm/ implementation of these four operations without using self-balancing BST. With our own defined structure, we need to write so many lines. However, I have heard that there is a possibility of supporting these four operators in less than 100 lines code :\ Do you guys have any ideas on how this should be done? Other than BST, is there any other possible options?