1,034 views
1 1 vote

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

2 Answers

1 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²)
0 0 votes
All the Elements have same values ,treated as sorted therefore worst case complexity , ie O(n^2)
Position:
Show:

Related questions

0 0 votes
1 1 answer
1.4k
1.4k views
akash.dinkar12 asked Jun 27, 2019
1,374 views
Show that the running time of QUICKSORT is $\Theta(n^2)$ when the array $A$ contains distinct elements and is sorted in decreasing order.
0 0 votes
0 0 answers
480
480 views
akash.dinkar12 asked Jun 27, 2019
480 views
Suppose that the splits at every level of quicksort are in the proportion $1-\alpha$ to $\alpha$, where $0<\alpha\leq1/2$ is a constant. Show that the minimum depth of a ...
0 0 votes
0 0 answers
711
711 views
akash.dinkar12 asked Jun 27, 2019
711 views
Banks often record transactions on an account in order of the times of the transactions, but many people like to receive their bank statements with checks listed in order...
0 0 votes
2 2 answers
1.0k
1.0k views
akash.dinkar12 asked Jun 28, 2019
1,003 views
Show that quicksort’s best-case running time is $\Omega(n\ lg\ n)$.