public void split(ref Treap <T> left, ref Treap <T> right, T key) { Treap <T> res = new Treap <T>(); copy(root, ref res.root); split(ref res.root, ref left.root, ref right.root, new node <T>(key)); }
public void join(Treap <T> t) { join(t.getroot()); }
public void split(ref Treap <T> left, ref Treap <T> right, T key) { split(root, left.getroot(), right.getroot(), new node <T> (key)); }