Question: Given an array with n elements sorted in ascending order, which of the following algorithms have the highest time complexity when sorting the array in
Given an array with n elements sorted in ascending order, which of the following algorithms have the highest time complexity when sorting the array in descending order? In case of a tie, select all that apply.
| A.Insertion sort | |
| B.Quick sort | |
| C.Bubble sort | |
| D.Merge sort |
2.
Using in place quicksort and always taking the first element as pivot to sort the array [3,6,4,5,2,1,7], what will be the order of the array after the first partition?
| A.[2, 1, 3, 4, 5, 6, 7] | |
| B.[2, 1, 3, 5, 4, 6, 7] | |
| C.[1, 2, 3, 5, 4, 6, 7] | |
| D.[1, 2, 3, 6, 5, 4, 7] |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
