persistent data structure (treap)