I"ve coded a Red Black binary statistic tree to get the rank of an arbitrary object that is comparable to the other objects in the Red Black tree. I wonder if there is an API class that provides the same functionality.
It would also be nice if given a rank, the class has a function to return an object of that rank within the tree.
Note that the Red-black BST allows these two operations in log(n) time where n is the number of objects in the tree.