Question: please do Q1 and Q2 I will give a like 1. Demonstrate the operation of Radix-Sort, similar to the figure below, on the following list

1. Demonstrate the operation of Radix-Sort, similar to the figure below, on the following list of 3 character strings: HIM, DAD, SAM, HAM, DID, DAM. You're not required to show any work aside from the steps shown in the example. 2. Suppose we took the Counting Sort code from lecture, and altered the last loop so that it goes up from 1 to A.length instead of down from A.length to 1 , as follows: \( \begin{array}{l} \text { ting_Sort }(A, k) \\ \text { let out }[1 \ldots . .1 \text { length }] \text { be a new array } \\ \text { let count }[1 \ldots k] \text { be a new array } \\ \text { for } i= 1 \text { to } k \\ \operatorname{count}[i]=0 \\ \text { for } j= 1 \text { to } A . \text { length } \\ \operatorname{count}[A[j]]+=1 \\ \text { for } i= 2 \text { to } k \\ \operatorname{count}[i]=\operatorname{count}[i]+\operatorname{count}[i- \\ \text { for } j= 1 \text { to } A \cdot l e n g t h \\ \text { key }=A[j] \\ \text { index }=\text { count }[k e y] \\ \text { out }[\text { index }]=\text { key } \\ \text { count }[k e y]-=1\end{array} \) Would the algorithm still sort correctly? Would it still be e? Explain your answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
