The Gateway to Computer Science Excellence
+1 vote
46 views

What is the running time of QUICKSORT when all elements of the array $A$ have the same value?

in Algorithms by Boss (41.9k points) | 46 views
0
$O(n^2)$

1 Answer

+1 vote
Total comparison =( n-1)+(n-2) +.....n

                                   =O(n²)

Quick sort will do worst case time complexity if array is already sorted ie O(n²)
by (67 points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,429 answers
195,206 comments
99,915 users