- 3 Pts Using The Figure Model In The Lecture Slides Illustrate The Operation Of Counting Sort On The Array A 5 1 1 (67.98 KiB) Viewed 102 times
(3 pts) using the figure model in the lecture slides, illustrate the operation of COUNTING-SORT on the array A = (5, 1,
-
- Site Admin
- Posts: 899559
- Joined: Mon Aug 02, 2021 8:13 am
(3 pts) using the figure model in the lecture slides, illustrate the operation of COUNTING-SORT on the array A = (5, 1,
(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