finish red black tree, add getRank and selectRank function