recategorized by
9,129 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

2.0k
views
1 answers
0 votes
iita asked Feb 7, 2017
1,987 views
Consider a scenario of modified quick sort, where we have given an input sorted array A[1 . . . n], all elements of array are distinct and n ≥ 3. Pivot is the median of ... n log log n)I think it will be B but they have given as A....???
867
views
1 answers
0 votes
LavTheRawkstar asked Jan 12, 2017
867 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[i+1] ← A[i]; i ← i – 1; }A[i+1] = key;
1.8k
views
2 answers
1 votes
vishal chugh asked Jan 24, 2018
1,841 views
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
12.4k
views
1 answers
1 votes
rahuldb asked May 7, 2017
12,372 views
Derive the best and worst case complexity of insertion sort algorithm?