The Gateway to Computer Science Excellence
+1 vote
100 views

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

in Algorithms by | 100 views

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

Related questions

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
52,345 questions
60,501 answers
201,871 comments
95,325 users