Question
Question 1 [15 points]: MCQ Highlight the correct answer. Choose the correct answer. 1) How many inversions do we have in this array: {RABITT}: a.
Question 1 [15 points]: MCQ Highlight the correct answer. Choose the correct answer. 1) How many inversions do we have in this array: {RABITT}: a. 3 b. 4 c. 5 d. 6
2) In insertion sort, which of the following is the best-case scenario in time complexity for the array A[]: a. A[]={ABCD} b. A[]={BACD} c. A[]={DCBA} d. all the same
3) In insertion sort, which of the following will have the most number of exchanges in the array A[]: a. A[]={ABCD} b. A[]={BACD} c. A[]={DCBA} d. all the same
4) How can you avoid the worst-case scenario in Quicksort? a. By creating an auxiliary array 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started