Under construction

An example data structure trace
N = 9
R = 3

The original array, A length N

0 1 1 2 0 0 1 2 2

The serial array, length N

"serial(i): the number of elements A( j) such that A( j) = A(i) and precede element i in its subarray"
For i=2: serial(2) = 1, since in the original sub-array there exists a j < i such that A(j) =A(i)
0 0 1 0 0 1 0 0 1

The num array, length R X N/R

"number(v, s): the number of elements of subarray Bs that have value v"
i.e below note that number(0,0) = 1 since there is only one 0 in the subarray 0 ()
1 20
2 01
0 12

......