1,089 views
0 0 votes
Consider all the elements of an array is same and choosing pivot such a way that divides array into two equal parts. Then will it behave like QuickSort best case or worst case?

Please log in or register to answer this question.

Position:
Show:

Related questions

2 2 votes
1 1 answer
141
141 views
GO Classes asked Aug 24
141 views
Consider three recursive algorithms.Algorithm $\mathbf{1}$Divides a problem of size $N$ into two subproblems of size $N/2$ and performs constant additional work.$T_1(N)=2...
5 5 votes
1 1 answer
334
334 views
GO Classes asked Aug 6
334 views
Randomized quicksort is applied to $n$ distinct keys, where $n$ is divisible by $16$.A pivot is chosen uniformly at random.What is the probability that both recursive sub...
3 3 votes
1 1 answer
188
188 views
GO Classes asked Aug 6
188 views
Consider an array of $2n$ elements of the form:$1,2n-1,2,2n-2,3,2n-3,4,2n-4,\ldots,n,n$For example, when $n=8$:$1,15,2,14,3,13,4,12,5,11,6,10,7,9,8,8$What is the number o...
3 3 votes
1 1 answer
178
178 views
GO Classes asked Aug 6
178 views
Consider the problem of sorting an array of $n$ comparable elements in which there are only four distinct keys.It is possible to design an algorithm that makes at most $4...