>
Exams
>
Computer Science & Information Technology
>
Computer Languages and Algorithms
>
which sorting algorithm has the same time complexi
Question:
Which sorting algorithm has the same time complexity for all the cases-best, average, worst?
Show Hint
Merge Sort: \[ O(n\log n) \] for Best, Average and Worst cases.
TS PGECET - 2026
TS PGECET
Updated On:
Jun 25, 2026
Bubble Sort
Quick Sort
Radix Sort
Merge Sort
Show Solution
Verified By Collegedunia
The Correct Option is
D
Solution and Explanation
Concept:
Sorting algorithms may exhibit different time complexities depending on input arrangement. We compare the complexities: \[ \text{Best Case} \] \[ \text{Average Case} \] \[ \text{Worst Case} \]
Step 1:
Analyze Bubble Sort.
Bubble Sort may achieve \[ O(n) \] in the best case (optimized version) and \[ O(n^2) \] in the worst case. Hence not equal.
Step 2:
Analyze Quick Sort.
Quick Sort: \[ O(n\log n) \] average case, \[ O(n^2) \] worst case. Hence not equal.
Step 3:
Analyze Merge Sort.
Merge Sort recursively divides the array and merges. Its complexity remains \[ O(n\log n) \] for: \[ \text{Best Case} \] \[ \text{Average Case} \] \[ \text{Worst Case} \]
Step 4:
Write the answer.
Therefore, \[ \boxed{\text{Merge Sort}} \] has identical asymptotic complexity in all cases. Hence option (D) is correct.
Download Solution in PDF
Was this answer helpful?
0
0
Top TS PGECET Computer Science & Information Technology Questions
The transition a pushdown automation made by is additionally dependent upon
TS PGECET - 2024
Computer Science & Information Technology
Theory of Computations
View Solution
Moore machine is an example of
TS PGECET - 2024
Computer Science & Information Technology
Theory of Computations
View Solution
For a machine to surpass all the letters of alphabets excluding vowels, how many states in DFA would be required?
TS PGECET - 2024
Computer Science & Information Technology
Theory of Computations
View Solution
A language $L$ is said to be Turing machine (TM) decidable if
TS PGECET - 2024
Computer Science & Information Technology
Theory of Computations
View Solution
A Turing machine that is able to simulate other Turing machines is known as
TS PGECET - 2024
Computer Science & Information Technology
Theory of Computations
View Solution
View More Questions
Top TS PGECET Computer Languages and Algorithms Questions
Given an array $A = \{15, 23, 27, 32, 45, 49, 60\}$ and key = 49, what are the mid values (corresponding array elements) in the first and second levels of recursion?
TS PGECET - 2024
Computer Science & Information Technology
Computer Languages and Algorithms
View Solution
What is the best case time complexity for linear search?
TS PGECET - 2024
Computer Science & Information Technology
Computer Languages and Algorithms
View Solution
How many solutions are there for the 8-Queen problem on an $8 \times 8$ chessboard?
TS PGECET - 2024
Computer Science & Information Technology
Computer Languages and Algorithms
View Solution
Which among the following is an external sorting technique?
TS PGECET - 2024
Computer Science & Information Technology
Computer Languages and Algorithms
View Solution
How many passes does an insertion sort algorithm take for sorting an array of ‘n’ elements?
TS PGECET - 2024
Computer Science & Information Technology
Computer Languages and Algorithms
View Solution
View More Questions
Top TS PGECET Questions
If \( P = \begin{pmatrix} 1 & 1 & 1 \\ 0 & 1 & 2 \\ 0 & 0 & 1 \end{pmatrix} \) is the modal matrix of \( A = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 2 & 2 \\ 0 & 0 & 3 \end{pmatrix} \) then the sum of all the elements of \( P^{-1}AP \) is
TS PGECET - 2024
Matrices
View Solution
If the system of equations \( kx + y + z = k - 1 \), \( x + ky + z = k - 1 \), and \( x + y + kz = k - 1 \) has infinite solutions, then \( k \) is
TS PGECET - 2024
Linear Programming
View Solution
The value of the integral \( \int_C (2xy - x^2) \, dx + (x^2 + y^2) \, dy \) where \( C \) is the boundary of the region enclosed by \( y = x^2 \) and \( y^2 = x \), described in the positive sense, is
TS PGECET - 2024
Calculus
View Solution
Let \( f(x) = \log x \). The number \( C \) strictly between \( e^2 \) and \( e^3 \) such that its reciprocal is equal to \( \frac{f(e^3) - f(e^2)}{e^3 - e^2} \) is
TS PGECET - 2024
Calculus
View Solution
The solution of the differential equation \( (D^2 + 2)y = x^2 \) is
TS PGECET - 2024
Differential Equations
View Solution
View More Questions