(Solved) : 1 6 Points Following Pseudo Code Shows Implementation Selection Sort Algorithm 1 Function Q43962501 . . .
1. (6 points) The following pseudo code shows an implementation of the selection sort algorithm. 1: function SELECTION-SORT(A, n) for i=1 to n-1 do mint i for j=i+1 to n do if A[j] < Amin) then mint j end if end for swap A[i], A[min] 10: end for 11: end function ” R ܘ̄ ܩ̈ܐ ܢ ܞ (a) Compute the worst case running time using the method shown in class for insertion sort. That is, assign a different constant to each of the lines 2-10 and use them to compute the running time. (b) Repeat part (a) for the best case running time. (c) Use the O-notation to compare the worst-case and best-case running times computed above to the following functions n, nlgn, and na. (d) Compare the worst and best case running times of the selection sort to the corresponding times of the insertion sort using one of the three notations, O, o, or w. Show transcribed image text 1. (6 points) The following pseudo code shows an implementation of the selection sort algorithm. 1: function SELECTION-SORT(A, n) for i=1 to n-1 do mint i for j=i+1 to n do if A[j]
Expert Answer
Answer to 1. (6 points) The following pseudo code shows an implementation of the selection sort algorithm. 1: function SELECTION-S…
OR