Redirected
retagged by
985 views
1 votes
1 votes

retagged by

3 Answers

1 votes
1 votes

 Insertion sort  $O(n)$
 Quick sort  $O(n) +O( \log n ) $
 merge sort
 Top Down $O(n) +O( \log n ) $
Bottom Up $O(n)$
 selection sort = $ O(n)$

None of the option matches

1 votes
1 votes
  • C and D cannot be the answer , since they require stack for recursive calls.
  • A and B , both are inplace sort and have Space complexity of O(1).

The answer should be A .. insertion Sort because in best case the number of comparisons become O(n).

0 votes
0 votes
C.Quick Sort is Inplace algorithm with max O(n^2) only for ascending or descending order elements.

Related questions

9 votes
9 votes
2 answers
1
vineet.ildm asked Nov 7, 2016
5,807 views
Why space complexity of heapsort is O(1)....and why not O(logn)..because of space required by recursion calls which is equivalent to height of the tree...where am i getti...
1 votes
1 votes
1 answer
3
reena_kandari asked Feb 5, 2017
1,733 views
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.A)insertion sor...
0 votes
0 votes
1 answer
4
Daniyal89 asked Sep 30, 2018
693 views
Ans given is option-B