rank range binary search tree