I'm trying to implement block sorting. This is from the Burrows Wheeler paper.
(Before this step, you create a V suffix array of S)
Q4. [radix sort]
Sort the elements of V , using the first two characters of each suffix as the
sort key. This can be done efficiently using radix sort.
So I understand you are sorting the suffixes with radix sort.
How is this supposed to update the array V? Only after the radix sort finished I can know the sorted position of a suffix. Suppose that the 4th suffix end up being the first after sorted. So V[0] = i. In this case, we know (because I told you) that i = 4. But how does the algorithm know that since we are not keeping track of their position. Should I make a Class that contains both the suffix and its suffix number?