Question: Choose the correct answer. 1) How many inversions do we have in this array: (RABBIT): a. 3 b. 4 c.5 d. 6 2) In insertion

 Choose the correct answer. 1) How many inversions do we have

Choose the correct answer. 1) How many inversions do we have in this array: (RABBIT): a. 3 b. 4 c.5 d. 6 2) In insertion sort, which of the following is the worst-case scenario in time complexity for the array A[]: a. All={ABCD b. A[]={BACD) c. A[]={DCBA d. all the same 3) In selection sort, which of the following will have the most number of exchanges in the array A[]: a. A1-ABCD b. A[1={BACD) c. A[]={DCBA d. all the same 4) How can you avoid the worst-case scenario in Quicksort? a. By choosing the last element as pivot b. By using insertion sort for small arrays c. By shuffling the array before sorting d. By applying selection sort for big arrays 5) Which of the following sorting algorithms has the best performance in the worst-case scenario? a. Insertion sort b. Quicksort c. Mergesort d. Selection sort

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