title: Computing rank of a node in a binary search tree
body: <p>If each node in a binary search tree stores its weight (number of nodes in its subtree), what  would be an efficient method to compute a rank of a given node (its index in the sorted list) as I search for it in the tree?</p>