Data Structures, Algorithms, & Applications in C++
Chapter 2, Exercise 9
The rank array is
[2, 1, 5, 4, 8, 3, 6, 0, 7]
.