retagged by
967 views

2 Answers

Best answer
5 votes
5 votes

Definition of Every Case Time Complexity: "If an algorithm's best-case and worst-case complexity are the same then it has "every-case" complexity" i.e. Algorithm's time complexity does not depend on the input value. 

In the Above

Quick Sort : Best (O(n.log n)) and Worst (O(n^2))

Insertion Sort : Best (O(n)) and Worst (O(n^2))

Selection Sort: Best (O(n^2)) and Worst (O(n^2))

Bubble Sort : Best (O(n)) and Worst (O(n^2))

Hence the answer is C) Selection Sort

selected by
0 votes
0 votes

Selection sort has time complexity O(n2) in all case .So option C is correct.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
3 answers
2
0 votes
0 votes
2 answers
3
kamboj asked Jan 22, 2017
1,622 views
Consider X[1, ..., n] and Y[1, ..., n] be two arrays each containing n-numbers both of which are already sorted. What is the time complexity to find median by combining t...
2 votes
2 votes
2 answers
4
Akriti sood asked Jan 22, 2017
860 views
as we already know the range,so can we use counting sort??and complexity of counting sort is O(n+k)what other method is there to know the missing number??