Anyone has any document or knowledge about performing reverse operation in segment tree by using treap ? There is a problem in Codechef that is required to do it, treap is mentioned but isn't explained in the tuttorial. Link to problem: http://www.codechef.com/problems/PALINDR