edited by
1,093 views

2 Answers

0 votes
0 votes
A. insertion sort - gives time complexity of O(n^2)

B. Quick sort - Ads the array is in reversed order, it is worst case for it, so time complexity O(n^2)

C. Merge sort - time complexity is O(nlogn), but takes additional time for unnecessary division.

D. Heap Sort - complexity O(nlogn). (Answer)
0 votes
0 votes
Best in terms of complexity :
Time complexity filter out and we have choice of merge and heap sort.
Space complexity selects heap sort as best due to extra space required by merge sort.
So best is Heap sort.

Related questions

2 votes
2 votes
2 answers
1
thor asked Nov 28, 2016
834 views
I answered this as $O(n^2)$ considering the question asks for best worst case of all inplace sorting algorithms.
1 votes
1 votes
5 answers
2
hitesh159 asked Apr 16, 2019
2,094 views
why not merge sort?we don’t swap in merge sort,we just create auxillary arrays and merge them by changing elements in the original array.should we consider that as a sw...
0 votes
0 votes
0 answers
4
Abhishek Kumar 38 asked Dec 19, 2018
627 views
Which of the following sorting algorithm represented by above code?