Question: 9:38 Task Code Output Complete the code given in the Python block to implement radix sort. Expected Output: Unsorted array is : (232, 543, 564,

9:38 Task Code Output Complete the code given in9:38 Task Code Output Complete the code given in9:38 Task Code Output Complete the code given in
9:38 Task Code Output Complete the code given in the Python block to implement radix sort. Expected Output: Unsorted array is : (232, 543, 564, 33, 2, 55, 899] Sorted array is: [2. 33, 55, 232, 543, 564, 899] Instructions: . Write the code in the editable section. . Click the Run Code button to execute the code Note: Please do not navigate without pressing the Run Code button. If anything goes wrong, click the Reset button and run your code again.1 # Create a function to do counting sort of array according to the digit represented by the place countSort(array, place): size = len(array) 2 E | P\\ 5 # Output array elements that will have a sorted array output = [0] * size # Initialize the count array as 0 count = [0] * 10 # Store the count of occurrences in count b range(0, size): index = array[i] // 9:39 Task Code Output PYTHON 14 count [ index % 10] .= 1 15 16 Change count [1] so that count[i] contains the actual position of the digit in the output array 17 for i in range(1, 10): 18 count [i] += count[i 1] 19 20 Create the output array 21 i = size - 1 22 while i >= 0: 23 index = array[i] // place 24 output [count [ index % 10] - 1] = array[1] 25 count [ index % 10] 26 -= 1 27 Input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Law Questions!