Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
37
votes
2
answers
541
GATE CSE 2013 | Question: 6
Which one of the following is the tightest upper bound that represents the number of swaps required to sort $n$ numbers using selection sort? $O(\log n$) $O(n$) $O(n \log n$) $O(n^{2}$)
Which one of the following is the tightest upper bound that represents the number of swaps required to sort $n$ numbers using selection sort?$O(\log n$)$O(n$)$O(n \log n$...
Arjun
10.1k
views
Arjun
asked
Sep 23, 2014
Algorithms
gatecse-2013
algorithms
sorting
easy
+
–
48
votes
5
answers
542
GATE CSE 2009 | Question: 39
In quick-sort, for sorting $n$ elements, the $\left(n/4\right)^{th}$ smallest element is selected as pivot using an $O(n)$ time algorithm. What is the worst case time complexity of the quick sort? $\Theta(n)$ $\Theta(n \log n)$ $\Theta(n^2)$ $\Theta(n^2 \log n)$
In quick-sort, for sorting $n$ elements, the $\left(n/4\right)^{th}$ smallest element is selected as pivot using an $O(n)$ time algorithm. What is the worst case time com...
Kathleen
21.3k
views
Kathleen
asked
Sep 22, 2014
Algorithms
gatecse-2009
algorithms
sorting
normal
+
–
30
votes
2
answers
543
GATE CSE 2009 | Question: 11
What is the number of swaps required to sort $n$ elements using selection sort, in the worst case? $\Theta(n)$ $\Theta(n \log n)$ $\Theta(n^2)$ $\Theta(n^2 \log n)$
What is the number of swaps required to sort $n$ elements using selection sort, in the worst case?$\Theta(n)$$\Theta(n \log n)$$\Theta(n^2)$$\Theta(n^2 \log n)$
Kathleen
27.8k
views
Kathleen
asked
Sep 22, 2014
Algorithms
gatecse-2009
algorithms
sorting
easy
+
–
24
votes
4
answers
544
GATE CSE 2007 | Question: 14
Which of the following sorting algorithms has the lowest worse-case complexity? Merge sort Bubble sort Quick sort Selection sort
Which of the following sorting algorithms has the lowest worse-case complexity?Merge sortBubble sortQuick sortSelection sort
Kathleen
10.9k
views
Kathleen
asked
Sep 21, 2014
Algorithms
gatecse-2007
algorithms
sorting
time-complexity
easy
+
–
77
votes
5
answers
545
GATE CSE 2004 | Question: 29
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of $n$ $n^2$ $n \log n$ $n \log^2n$
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of$n$$n^2$$n \log n$$n \log^2n$
Kathleen
33.5k
views
Kathleen
asked
Sep 18, 2014
Algorithms
gatecse-2004
algorithms
sorting
asymptotic-notation
easy
+
–
39
votes
4
answers
546
GATE CSE 2006 | Question: 14, ISRO2011-14
Which one of the following in place sorting algorithms needs the minimum number of swaps? Quick sort Insertion sort Selection sort Heap sort
Which one of the following in place sorting algorithms needs the minimum number of swaps?Quick sortInsertion sortSelection sortHeap sort
Rucha Shelke
25.4k
views
Rucha Shelke
asked
Sep 17, 2014
Algorithms
gatecse-2006
algorithms
sorting
easy
isro2011
+
–
66
votes
12
answers
547
GATE CSE 2003 | Question: 61
In a permutation \(a_1 ... a_n\), of n distinct integers, an inversion is a pair \((a_i, a_j)\) such that \(i < j\) and \(a_i > a_j\). If all permutations are equally likely, what is the expected number of inversions in a randomly chosen permutation of \(1. . . n\)? \(\frac{n(n-1)}{2}\) \(\frac{n(n-1)}{4}\) \(\frac{n(n+1)}{4}\) \(2n[\log_2n]\)
In a permutation \(a_1 ... a_n\), of n distinct integers, an inversion is a pair \((a_i, a_j)\) such that \(i < j\) and \(a_i a_j\).If all permutations are equally likel...
Kathleen
22.0k
views
Kathleen
asked
Sep 17, 2014
Algorithms
gatecse-2003
algorithms
sorting
inversion
normal
+
–
63
votes
2
answers
548
GATE CSE 2003 | Question: 22
The usual $\Theta(n^2)$ implementation of Insertion Sort to sort an array uses linear search to identify the position where an element is to be inserted into the already sorted part of the array. If, instead, we use binary search to identify the position, the worst case running ... $\Theta(n^2)$ become $\Theta(n (\log n)^2)$ become $\Theta(n \log n)$ become $\Theta(n)$
The usual $\Theta(n^2)$ implementation of Insertion Sort to sort an array uses linear search to identify the position where an element is to be inserted into the already ...
Kathleen
15.8k
views
Kathleen
asked
Sep 16, 2014
Algorithms
gatecse-2003
algorithms
sorting
time-complexity
normal
+
–
75
votes
15
answers
549
GATE CSE 2005 | Question: 39
Suppose there are $\lceil \log n \rceil$ sorted lists of $\lfloor n /\log n \rfloor$ elements each. The time complexity of producing a sorted list of all these elements is: (Hint:Use a heap data structure) $O(n \log \log n)$ $\Theta(n \log n)$ $\Omega(n \log n)$ $\Omega\left(n^{3/2}\right)$
Suppose there are $\lceil \log n \rceil$ sorted lists of $\lfloor n /\log n \rfloor$ elements each. The time complexity of producing a sorted list of all these elements i...
gatecse
26.4k
views
gatecse
asked
Sep 15, 2014
Algorithms
gatecse-2005
algorithms
sorting
normal
+
–
43
votes
4
answers
550
GATE CSE 2001 | Question: 1.14
Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using Randomized quicksort? $O(n)$ $O(n \log n)$ $O(n^2)$ $O(n!)$
Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using Randomized quicksort?$O...
Kathleen
13.7k
views
Kathleen
asked
Sep 14, 2014
Algorithms
gatecse-2001
algorithms
sorting
time-complexity
easy
+
–
42
votes
6
answers
551
GATE CSE 2000 | Question: 17
An array contains four occurrences of $0$, five occurrences of $1$, and three occurrences of $2$ in any order. The array is to be sorted using swap operations (elements that are swapped need to be adjacent). What is the minimum number of swaps ... ? Give an ordering of elements in the above array so that the minimum number of swaps needed to sort the array is maximum.
An array contains four occurrences of $0$, five occurrences of $1$, and three occurrences of $2$ in any order. The array is to be sorted using swap operations (elements t...
Kathleen
11.0k
views
Kathleen
asked
Sep 14, 2014
Algorithms
gatecse-2000
algorithms
sorting
normal
descriptive
+
–
23
votes
3
answers
552
GATE CSE 1992 | Question: 03,iv
Assume that the last element of the set is used as partition element in Quicksort. If $n$ distinct elements from the set $\left[1\dots n\right]$ are to be sorted, give an input for which Quicksort takes maximum time.
Assume that the last element of the set is used as partition element in Quicksort. If $n$ distinct elements from the set $\left[1\dots n\right]$ are to be sorted, give an...
Kathleen
4.6k
views
Kathleen
asked
Sep 13, 2014
Algorithms
gate1992
algorithms
sorting
easy
quick-sort
descriptive
+
–
39
votes
5
answers
553
GATE CSE 1992 | Question: 02,ix
Following algorithm(s) can be used to sort $n$ in the range $[1\ldots n^3]$ in $O(n)$ time Heap sort Quick sort Merge sort Radix sort
Following algorithm(s) can be used to sort $n$ in the range $[1\ldots n^3]$ in $O(n)$ timeHeap sortQuick sortMerge sortRadix sort
Kathleen
16.7k
views
Kathleen
asked
Sep 12, 2014
Algorithms
gate1992
easy
algorithms
sorting
multiple-selects
+
–
26
votes
5
answers
554
GATE CSE 1991 | Question: 13
Give an optimal algorithm in pseudo-code for sorting a sequence of $n$ numbers which has only $k$ distinct numbers ($k$ is not known a Priori). Give a brief analysis for the time-complexity of your algorithm.
Give an optimal algorithm in pseudo-code for sorting a sequence of $n$ numbers which has only $k$ distinct numbers ($k$ is not known a Priori). Give a brief analysis for ...
Kathleen
6.7k
views
Kathleen
asked
Sep 12, 2014
Algorithms
gate1991
sorting
time-complexity
algorithms
difficult
descriptive
+
–
50
votes
3
answers
555
GATE CSE 1991 | Question: 01,vii
The minimum number of comparisons required to sort $5$ elements is ______
The minimum number of comparisons required to sort $5$ elements is ______
Kathleen
8.8k
views
Kathleen
asked
Sep 12, 2014
Algorithms
gate1991
normal
algorithms
sorting
numerical-answers
+
–
46
votes
4
answers
556
GATE CSE 2008 | Question: 43
Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fifth of the elements. Let $T(n)$ be the number of comparisons required to sort $n$ elements. Then $T(n) \leq 2T(n/5) + n$ $T(n) \leq T(n/5) + T(4n/5) + n$ $T(n) \leq 2T(4n/5) + n$ $T(n) \leq 2T(n/2) + n$
Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fi...
Kathleen
16.4k
views
Kathleen
asked
Sep 12, 2014
Algorithms
gatecse-2008
algorithms
sorting
easy
+
–
Page:
« prev
1
...
14
15
16
17
18
19
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register