201 Posted Topics

Member Avatar for Direwolf007

How about the following psuedo-code, I think it should do the trick: [LIST=1][*]B[][] = new Array[n][n][*]C[] = new Array[n][*]for i: 1 to n do[*]----C[i] = 0[*]for j: 1 to n do[*]----d=(A[j]/n)+1[*]----B[d][C[d]] = A[j][*]----C[d]++[*]for i: 1 to n do[*]// Perform a version of counting sort on each sub array (bucket). the …

Member Avatar for Direwolf007
0
181

The End.