Assume that we want to find the k-th element of a set (according to the ordering on T) in time limited by C . (tree height). What additional information do we need to store at the tree vertices?
At each vertex, we store the number of its descendants. When a vertex is added or deleted, this information must be updated along a path from the root to the new/deleted vertex. While searching for the k-th vertex, we maintain the following invariant: the vertex in question is the s-th vertex (according to the T-ordering) of a subtree rooted at x (here s and x are variables).