The rank of a node is the number of nodes in the tree that have a value less than the current node.