Modified Treap.cpp