in Algorithms recategorized by
1,815 views
1 vote
1 vote

Quick-sort is run on $2$ inputs shown below to sort in ascending order :

  1. $1,2,3\ldots n$
  2. $n,n-1,n-2\ldots 1$

Let $C$1 and $C2$ be the number of comparisons made for A and B respectively. Then, 

  1. $C1>C2$
  2. $C1=C2$
  3. $C1<C2$
  4. Cannot say anything for arbitrary $n$
in Algorithms recategorized by
by
1.8k views

1 comment

They haven't said anything about the pivot. Only if in both the cases the greatest or the smallest element is chosen, worst case occurs. Else can't say anything about the number of comparisons.
1
1

1 Answer

5 votes
5 votes
option b as both are worst case in the case of quick sort.

4 Comments

ISRO corrected this in revised key,

Answer is B

2
2
@Shiva, can u plz provide me a link to this Question paper revised answer keys??
1
1
0
0
Answer:

Related questions