Question: How many comparisons are needed to sort an array of length 5 if a selection sort is used and array is already in the opposite

How many comparisons are needed to sort an array of length 5 if a selection sort is used and array is already in the opposite order? (i)1(ii)5(iii)10(iv)20(f) In a selection sort structure, there is/are?(i) Two separate for loops (ii) Three for loops, all separate (iii) Two for loops, one nested in the other (iv) A for loop nested inside a while loop (g) For selection sort, how many steps there will be for a list of 10 elements? (i)11(ii)9(iii)20(iv)25(h) What is the output of the code below if the input array is 12,34,56,29,78, and the x=21? int fun(int arr[], int N, int x){ for (int i =0; i < N; i++) if (arr[i]== x) return i; return -1; }(i)0(ii)1(iii)-1(iv) None (i) Can values of different types be stored in a same array? (yes/no)(j) As parameters, two dimensional arrays are passed either by value or by reference. (True/False?)

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 Programming Questions!