• edited by
2,016 views

2 Answers

Best answer
4 4 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 0 votes

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

Position:
Show:

Related questions

0 0 votes
1 1 answer
1.6k
1.6k views
GateAspirant999 asked Sep 16, 2018
1,572 views
Consider the following sorting algorithmSorting (A, low, high)Iif (low == high) return;if (low $+1==$ high)Iif $(\mathrm{A}[$ low $]>\mathrm{A}[$ high $])$swap (A[low], A...
0 0 votes
3 3 answers
2.7k
2.7k views
Deepalitrapti asked Sep 12, 2018
2,681 views
14Computer Science \& ITAlgorithm, DataQ. 78 Given a sorted array of n-elements where other than one element $x$ every other element repeat two times. Then how much time ...
0 0 votes
2 2 answers
2.2k
2.2k views
kamboj asked Jan 22, 2017
2,172 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 2 votes
2 answers 2 answers
2.1k
2.1k views
Akriti sood asked Jan 22, 2017
2,138 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??Assume $A$ is an...