recategorized by
1,925 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

3.4k
views
2 answers
1 votes
gatecse asked Dec 17, 2017
3,444 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$ ... $C$M$P$
1.5k
views
2 answers
3 votes
gatecse asked Dec 17, 2017
1,475 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 maintained.It takes $O(n)$ space.
1.8k
views
1 answers
4 votes
gatecse asked Dec 17, 2017
1,768 views
Match the following and choose the correct answer for the order $A,B,C,D$ ... c-s, d-qa-q, b-s, c-p, d-ra-s, b-p, c-q, d-r
3.1k
views
2 answers
3 votes
gatecse asked Dec 17, 2017
3,081 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(\log n)$