splay tree with reverse and RMQ