(3 pts) using the figure model in the lecture slides, illustrate the operation of COUNTING-SORT on the array A = (5, 1,
Posted: Tue Sep 07, 2021 7:17 am
(3 pts) using the figure model in the lecture slides, illustrate the operation of COUNTING-SORT on the array A = (5, 1, 3, 1, 0, 2, 4, 6, 0, 3, 2) . (Note: You should show all your works in order to receive a full grade) COUNTING-SORT(A, B, k) for i = 0 to k C +0 for j = 1 to A.length C[A[j]] + C[A[j]] + 1 for i = 1 to k C + C + C[i – 1] for j = A.length downto 1 B[C[A[j]]] + A[j] C[A[j]] + C[A[j]] - 1