4,050 views

3 Answers

10 votes
10 votes
Insertion Sort.

To sort the first 10 elements- maximum $O(10^2) = O(1)$ time complexity.

Next, $n-60$ elements take $\Theta(n-60)$ time as these would involve no shifting among themselves)

Final 50 elements take $\Theta(50n) = \Theta(n)$ time in worst case to place each of the 50 elements in position.

So, totally $\Theta(n)$.
edited by
0 votes
0 votes

Whether first i elements or last k are unsorted, it is ultimately an unsorted array only. So it is not the best case. It may be average case or worst case, since we don't know thw inputs. Comparing all the sort given in the option it is either Merge sort or quick sort. Correct me, if I missed something.

0 votes
0 votes
merge sort as its average or worst case complexity is better than that of quick sort

Related questions

1 votes
1 votes
1 answer
1
moin asked Mar 7, 2017
958 views
which sorting algorihm is used if we have a telephone directory wit 1,00,000 entries ?
0 votes
0 votes
1 answer
2
Himanshu1 asked Jan 17, 2016
1,748 views
If input is sorted in reverse order , then which sorting algorithm will perform best -A) Insertion SortB) Merge SortC) Heap SortD) Quick Sort
0 votes
0 votes
2 answers
4
_Madhuri asked Oct 9, 2021
631 views
The complexity of comparison based sorting algorithm is (nlogn) .How?