Evening, all. I'm trying to design a program that takes an input file with commands and integers, and uses those to build and manipulate an AVL tree. For the most part, it's working for me, however I'm hanging up on two functions. One is called RANK, and it basically says how many nodes have keys of a lower value than a given x.
The other is called SELECT, and it returns the element with the ith smallest key in the array. I know that these can somehow be manipulated using a traversal, but that's tripping me up in the implementation. Any help would be greatly appreciated. These are the functions as I have them now.