recategorized by
8,840 views
1 votes
1 votes

Which of the below given sorting techniques has highest best-case runtime complexity.
(A) Quick sort

(B) Selection sort
(C) Insertion sort

(D) Bubble sort


Answer: (B)

Explanation:
Quick sort best case time complexity is Ο(n logn)
Selection sort best case time complexity is Ο(n^2 )

Insertion sort best case time complexity is Ο(n)

Bubble sort best case time complexity is Ο(n)

Source: GeeksforGeeks

https://www.geeksforgeeks.org/gate-gate-mock-2017-question-12/

I did not understand this as best case time should be O(n) sorting method what does highest best cases mean?

recategorized by

1 Answer

0 votes
0 votes
According to the question answer should be option B)Selection sort with highest best case complexity ie O(n^2)
Answer:

Related questions

0 votes
0 votes
1 answer
2
LavTheRawkstar asked Jan 12, 2017
833 views
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i 0 and A[i] key) { A[...
1 votes
1 votes
2 answers
3
vishal chugh asked Jan 24, 2018
1,780 views
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
1 votes
1 votes
1 answer
4
rahuldb asked May 7, 2017
12,268 views
Derive the best and worst case complexity of insertion sort algorithm?