Click here to Skip to main content
16,004,653 members

Comments by Martin Capoušek (Top 1 by date)

Martin Capoušek 28-Nov-11 6:55am View    
Deleted
1) Not so optimal code (indexing):

//Count the number of each number (confusing I know) and place that
//value into the array C.
for(int j = 0; j < arrayA_length; j++)
arrayC[arrayA[j]] = arrayC[arrayA[j]] + 1;

2) Bug (out of range):

//Place the number of elements less than each value at i into array C.
for(int i = 0; i <= k; i++)
arrayC[i] = arrayC[i] + arrayC[i-1];
|
|here