35. Complete the pseudo code below for the counting sort algorithm. We assume
Input: A[1. . n],where A[j]
{0, 1, , k} forj = 1, 2,..., n. Array A and values n and k are given as parameters.
Output: B[1 . . n], sorted. B is assumed to be already allocated and is given as a parameter.
Auxiliary storage: C[O . . k]
COUNTING-SORT(A, B, n, k)
(A) 
(B)
(C)
(D)
(E)
答案:登入後查看
統計: A(0), B(0), C(0), D(0), E(1) #3067441
統計: A(0), B(0), C(0), D(0), E(1) #3067441