- This binary search tree algorithm allows single-pass, top-down treap key removal.
- Each node has two links (lt is short for less than, gt is short for greater than) and a key.
- The rmroot function takes as input a binary search tree consisting of one or more nodes.
- This tree matches the result of inserting keys k1, k2, k3, ..., kn (in that order) into an empty tree.
- The hash function is pseudorandom and hash(k1) < hash(k2) < hash(k3) < ... < hash(kn).
- The output tree matches the result of inserting k2, k3, ..., kn (in that order) into an empty tree.

To receive a hint, submit unfixed code.