previous | start | next

Insert the Elements (next 2 elements)

Copy the values from the array a to an auxilliary array, aux, at the index indicated by the count array and update that index for the digit position for this pass.

                       old    updated
      a               count   count           aux
 0   412           0    0       0          0   
 1   012           1    1       12   1   101
 2   101           2    2       345   2   
 3   432           3    4       7         3   412
 4   302           4    0       7         4   012
 5   201           5    0       7         5   
 6   410           6    0       7         6   
                   .    .       .
                   .    .       .
                   9    0       7
   


previous | start | next