edited by
5,123 views
0 0 votes

Which of the following input will give best case time for selection sort?

(A) 1 2 3 4 5 6 7 8 9 10

(B) 2 3 1 5 9 7 8 6 10

(C) 10 9 8 7 6 5 4 3 2 1 

(D) All of above take same amount of time

1 Answer

0 0 votes
Option D) All take same time as Complexity of Selection sort in every case is O(n^2)
Position:
Show:

Related questions

4 4 votes
4 answers 4 answers
4.8k
4.8k views
Ramij asked Dec 20, 2018
4,760 views
Suppose there are 4 sorted list of 16 elements each. If we merge these lists into a single sorted list of 64 elements. The key comparisons that are needed in the worst ca...
4 4 votes
1 1 answer
2.7k
2.7k views
charul asked Nov 27, 2017
2,679 views
Consider the following statements:S1 : On any random input insertion sort is work more efficiently than bubble sort.S2 : Average number of comparison of insertion sort ...
0 0 votes
2 2 answers
1.2k
1.2k views
naveen81 asked Jan 30, 2017
1,241 views
a. i>0,K>0, a[K] a[max]b. i>0,K<0, a[K]< a[max]c. i<0,K>0, a[K] a[max]d. i>0,K>0, a[K]< a[max]
3 3 votes
4 4 answers
2.5k
2.5k views
newdreamz a1-z0 asked Jan 21, 2019
2,452 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 se...