add another count property for current node, left subtree's node number as current node's count we can keep track of count in a subtree of any node while building the tree. reference: http://www.geeksforgeeks.org/find-k-th-smallest-element-in-bst-order-statistics-in-bst/...