recategorized by
1,837 views
1 votes
1 votes

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$
recategorized by

1 Answer

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

Related questions

1 votes
1 votes
2 answers
1
gatecse asked Dec 17, 2017
3,330 views
The characters of the string $\text{K R P C S N Y T J M}$ are inserted into a hash table of the size of size $10$ using a hash function$h(x)=(ord(x)-ord(A)+1)$ $mod$ $10$...
3 votes
3 votes
2 answers
2
gatecse asked Dec 17, 2017
1,427 views
A sorting technique is called stable ifIf it takes $O(n\log n)$ time.It uses divide and conquer technique.Relative order of occurrence of non-distinct elements is maintai...
4 votes
4 votes
1 answer
3
gatecse asked Dec 17, 2017
1,715 views
Match the following and choose the correct answer for the order $A,B,C,D$$$\begin{array}{|ll|ll|}\hline \text{A.} & \text{Strassen matrix multiplication} & \text{p.} & ...
3 votes
3 votes
2 answers
4
gatecse asked Dec 17, 2017
3,021 views
Consider the recurrence equation$T(n) =\begin{cases}2T(n-1), & \text{if }n>0 \\1, & \text{otherwise}\end{cases}$Then $T(n)$ is (in $big\, O$ order)$O(n)$$O(2^n)$$O(1)$$O(...