Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
1
votes
1
answer
511
What is the proper order in which we can arrange the sorting algos in terms of the number of swap operations they do ?
I am not getting which algorithm has minimum no of swap operations , acc to me both selection and insertion should be at the lowest level as well as merge sort since afte...
radha gogia
846
views
radha gogia
asked
Jul 16, 2015
Algorithms
sorting
+
–
6
votes
2
answers
512
Assume that a CPU can process $10^8$ operations per second. Suppose you have to sort an array with $10^6$ elements. Which of the following is true?
Assume that a CPU can process $10^8$ operations per second. Suppose you have to sort an array with $10^6$ elements. Which of the following is true? 1. Insertion sort will...
radha gogia
9.1k
views
radha gogia
asked
Jul 15, 2015
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
513
DATA STRUCTURES
Suppose we are comparing implementations of insetion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n^2 steps, while merge sort runs in 64nlgn steps. For which values of n does insertion sort beat merge sort?
Suppose we are comparing implementations of insetion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n^2 steps, while merge sort ru...
spriti1991
855
views
spriti1991
asked
May 20, 2015
Algorithms
algorithms
sorting
merge-sort
+
–
1
votes
1
answer
514
Time complexity
In the best case, the number of comparisons needed to search a single linked list of length n for a given element is is ............ and In the best case, the number of comparisons needed to search a double linked list of length n for a given element is ................ and is it possible to apply binary search on single linked list if the elements are sorted?
In the best case, the number of comparisons needed to search a single linked list of length n for a given element is is ............and In the best case, the number of co...
supraja
864
views
supraja
asked
Apr 20, 2015
Algorithms
time-complexity
sorting
+
–
0
votes
2
answers
515
Time complexity
Consider a sorted array of 'n' elements an element in the array is said to be majority element if it is occuring more than n/2 times of the array, the time complexity of algorithm which is most efficient to determine if the array contains majority element or not is O(... )?
Consider a sorted array of 'n' elements an element in the array is said to be majority element if it is occuring more than n/2 times of the array, the time complexity of ...
supraja
347
views
supraja
asked
Apr 18, 2015
Algorithms
sorting
time-complexity
+
–
0
votes
1
answer
516
minimum number of comparison required to compute the largest and second largest element in an array is
a) n- ( lg(n)) - 2b) n + (lg(n)-2)
soorajchn
5.5k
views
soorajchn
asked
Mar 14, 2015
Algorithms
sorting
+
–
59
votes
5
answers
517
GATE CSE 2015 Set 3 | Question: 27
Assume that a mergesort algorithm in the worst case takes $30$ seconds for an input of size $64$. Which of the following most closely approximates the maximum input size of a problem that can be solved in $6$ minutes? $256$ $512$ $1024$ $2018$
Assume that a mergesort algorithm in the worst case takes $30$ seconds for an input of size $64$. Which of the following most closely approximates the maximum input size ...
go_editor
20.1k
views
go_editor
asked
Feb 15, 2015
Algorithms
gatecse-2015-set3
algorithms
sorting
+
–
55
votes
7
answers
518
GATE CSE 2015 Set 2 | Question: 45
Suppose you are provided with the following function declaration in the C programming language. int partition(int a[], int n); The function treats the first element of $a[\:]$ as a pivot and rearranges the array so that all elements less than or equal to the pivot is in the ... $(a, $ left_end$, k)$ $(a, n-$left_end$-1, k-$left_end$-1)$ and $(a, $left_end$, k)$
Suppose you are provided with the following function declaration in the C programming language.int partition(int a[], int n);The function treats the first element of $a[\...
go_editor
16.7k
views
go_editor
asked
Feb 13, 2015
Algorithms
gatecse-2015-set2
algorithms
normal
sorting
+
–
34
votes
3
answers
519
GATE CSE 2015 Set 1 | Question: 2
Which one of the following is the recurrence equation for the worst case time complexity of the quick sort algorithm for sorting $n\;( \geq 2)$ numbers? In the recurrence equations given in the options below, $c$ is a constant. $T(n) = 2 T (n/2) + cn$ $T(n) = T ( n - 1) + T(1) + cn$ $T(n) = 2T ( n - 1) + cn$ $T(n) = T (n/2) + cn$
Which one of the following is the recurrence equation for the worst case time complexity of the quick sort algorithm for sorting $n\;( \geq 2)$ numbers? In the recurrenc...
makhdoom ghaya
11.6k
views
makhdoom ghaya
asked
Feb 11, 2015
Algorithms
gatecse-2015-set1
algorithms
recurrence-relation
sorting
easy
+
–
0
votes
1
answer
520
How can we found second smallest element with n+[lgn]-2 comparisons in worst case ??
Abhishek Kumar
3.5k
views
Abhishek Kumar
asked
Jan 10, 2015
Algorithms
divide-and-conquer
sorting
algorithms
+
–
2
votes
1
answer
521
Best algorithm in terms of time to sort numbers within range 1 to n^5
GateMaster Prime
1.3k
views
GateMaster Prime
asked
Dec 28, 2014
Algorithms
algorithms
sorting
+
–
0
votes
1
answer
522
sorting
dhingrak
1.1k
views
dhingrak
asked
Dec 11, 2014
Algorithms
sorting
time-complexity
test-series
+
–
0
votes
1
answer
523
Explain
Isha Karn
372
views
Isha Karn
asked
Dec 5, 2014
Algorithms
dijkstras-algorithm
sorting
time-complexity
test-series
+
–
56
votes
5
answers
524
GATE IT 2005 | Question: 59
Let $a$ and $b$ be two sorted arrays containing $n$ integers each, in non-decreasing order. Let $c$ be a sorted array containing $2n$ integers obtained by merging the two arrays $a$ and $b$. Assuming the arrays are indexed starting from $0$, consider the following ... Which of the following is TRUE? only I and II only I and IV only II and III only III and IV
Let $a$ and $b$ be two sorted arrays containing $n$ integers each, in non-decreasing order. Let $c$ be a sorted array containing $2n$ integers obtained by merging the two...
Ishrat Jahan
11.9k
views
Ishrat Jahan
asked
Nov 3, 2014
Algorithms
gateit-2005
algorithms
sorting
normal
+
–
66
votes
7
answers
525
GATE IT 2008 | Question: 43
If we use Radix Sort to sort $n$ integers in the range $\left (n^{k/2}, n^k \right ]$, for some $k > 0$ which is independent of $n$, the time taken would be? $\Theta(n)$ $\Theta(kn)$ $\Theta(n \log n)$ $\Theta(n^2)$
If we use Radix Sort to sort $n$ integers in the range $\left (n^{k/2}, n^k \right ]$, for some $k 0$ which is independent of $n$, the time taken would be?$\Theta(n)$$\T...
Ishrat Jahan
20.8k
views
Ishrat Jahan
asked
Oct 28, 2014
Algorithms
gateit-2008
algorithms
sorting
normal
+
–
35
votes
2
answers
526
GATE CSE 1996 | Question: 14
A two dimensional array $A[1..n][1..n]$ of integers is partially sorted if $\forall i, j\in [1..n-1], A[i][j] < A[i][j+1] \text{ and } A[i][j] < A[i+1][j]$ The smallest item in the array is at $A[i][j]$ where $i=\_\_$ and $j=\_\_$. The smallest ... if A[i+1][j] < A[i][j] ___ then begin A[i][j]:=A[i+1][j]; i:=i+1; end else begin _____ end A[i][j]:= ____ end
A two dimensional array $A[1..n][1..n]$ of integers is partially sorted if $\forall i, j\in [1..n-1], A[i][j] < A[i][j+1] \text{ and } A[i][j] < A[i+1][j]$The smallest it...
Kathleen
5.8k
views
Kathleen
asked
Oct 9, 2014
Algorithms
gate1996
algorithms
sorting
normal
descriptive
+
–
31
votes
3
answers
527
GATE CSE 1996 | Question: 2.15
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot $1, 2, 3, \dots n$ $n, n-1, n-2, \dots, 2, 1$ Let $C_1$ and $C_2$ be the number of comparisons made for the inputs (i) and (ii) respectively. Then, $C_1 < C_2$ $C_1 > C_2$ $C_1 = C_2$ we cannot say anything for arbitrary $n$
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot$1, 2, 3, \dots n$$n, n-1, n-2, \dots, 2, 1$Let $C_1$ and $C_2$ be the...
Kathleen
11.1k
views
Kathleen
asked
Oct 9, 2014
Algorithms
gate1996
algorithms
sorting
normal
+
–
18
votes
2
answers
528
GATE CSE 1995 | Question: 12
Consider the following sequence of numbers:$92, 37, 52, 12, 11, 25$ Use Bubble sort to arrange the sequence in ascending order. Give the sequence at the end of each of the first five passes.
Consider the following sequence of numbers:$$92, 37, 52, 12, 11, 25$$ Use Bubble sort to arrange the sequence in ascending order. Give the sequence at the end of each of ...
Kathleen
8.6k
views
Kathleen
asked
Oct 8, 2014
Algorithms
gate1995
algorithms
sorting
easy
descriptive
+
–
35
votes
6
answers
529
GATE CSE 1995 | Question: 1.16
For merging two sorted lists of sizes $m$ and $n$ into a sorted list of size $m+n$, we require comparisons of $O(m)$ $O(n)$ $O(m+n)$ $O(\log m + \log n)$
For merging two sorted lists of sizes $m$ and $n$ into a sorted list of size $m+n$, we require comparisons of$O(m)$$O(n)$$O(m+n)$$O(\log m + \log n)$
Kathleen
48.0k
views
Kathleen
asked
Oct 8, 2014
Algorithms
gate1995
algorithms
sorting
normal
+
–
21
votes
2
answers
530
GATE CSE 1995 | Question: 1.5
Merge sort uses: Divide and conquer strategy Backtracking approach Heuristic search Greedy approach
Merge sort uses:Divide and conquer strategyBacktracking approachHeuristic searchGreedy approach
Kathleen
5.0k
views
Kathleen
asked
Oct 8, 2014
Algorithms
gate1995
algorithms
sorting
easy
algorithm-design-technique
merge-sort
+
–
61
votes
10
answers
531
GATE CSE 2014 Set 3 | Question: 14
You have an array of $n$ elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is $O(n^2)$ $O(n \log n)$ $\Theta(n\log n)$ $O(n^3)$
You have an array of $n$ elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the...
go_editor
30.9k
views
go_editor
asked
Sep 28, 2014
Algorithms
gatecse-2014-set3
algorithms
sorting
easy
+
–
86
votes
8
answers
532
GATE CSE 2014 Set 2 | Question: 38
Suppose $P, Q, R, S, T$ are sorted sequences having lengths $20, 24, 30, 35, 50$ respectively. They are to be merged into a single sequence by merging together two sequences at a time. The number of comparisons that will be needed in the worst case by the optimal algorithm for doing this is ____.
Suppose $P, Q, R, S, T$ are sorted sequences having lengths $20, 24, 30, 35, 50$ respectively. They are to be merged into a single sequence by merging together two sequen...
go_editor
25.0k
views
go_editor
asked
Sep 28, 2014
Algorithms
gatecse-2014-set2
algorithms
sorting
normal
numerical-answers
+
–
44
votes
4
answers
533
GATE CSE 2006 | Question: 52
The median of $n$ elements can be found in $O(n)$ time. Which one of the following is correct about the complexity of quick sort, in which median is selected as pivot? $\Theta (n)$ $\Theta (n \log n)$ $\Theta (n^{2})$ $\Theta (n^{3})$
The median of $n$ elements can be found in $O(n)$ time. Which one of the following is correct about the complexity of quick sort, in which median is selected as pivot?$\T...
Rucha Shelke
53.4k
views
Rucha Shelke
asked
Sep 26, 2014
Algorithms
gatecse-2006
algorithms
sorting
easy
+
–
46
votes
6
answers
534
GATE CSE 2014 Set 1 | Question: 14
Let $P$ be quicksort program to sort numbers in ascending order using the first element as the pivot. Let $t_1$ and $t_2$ be the number of comparisons made by P for the inputs $[1 \ 2 \ 3 \ 4 \ 5]$ and $[4 \ 1 \ 5 \ 3 \ 2]$ respectively. Which one of the following holds? $t_1 = 5$ $t_1 < t_2$ $t_1>t_2$ $t_1 = t_2$
Let $P$ be quicksort program to sort numbers in ascending order using the first element as the pivot. Let $t_1$ and $t_2$ be the number of comparisons made by P for the i...
go_editor
19.4k
views
go_editor
asked
Sep 26, 2014
Algorithms
gatecse-2014-set1
algorithms
sorting
easy
+
–
72
votes
14
answers
535
GATE CSE 2012 | Question: 39
A list of $n$ strings, each of length $n$, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is $O (n \log n) $ $ O(n^{2} \log n) $ $ O(n^{2} + \log n) $ $ O(n^{2}) $
A list of $n$ strings, each of length $n$, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is$O (n \log...
gatecse
29.0k
views
gatecse
asked
Sep 26, 2014
Algorithms
gatecse-2012
algorithms
sorting
normal
+
–
26
votes
3
answers
536
GATE CSE 1998 | Question: 1.22
Give the correct matching for the following pairs: ... $\text{A-R B-P C-S D-Q}$ $\text{A-P B-R C-S D-Q}$ $\text{A-P B-S C-R D-Q}$
Give the correct matching for the following pairs: $$\begin{array}{ll|ll}\hline \text{(A)} & \text{$O (\log n)$} & \text{(P)} & \text{Selection} \\\hline \text{(B)} & \t...
Kathleen
7.9k
views
Kathleen
asked
Sep 25, 2014
Algorithms
gate1998
algorithms
sorting
easy
match-the-following
+
–
6
votes
3
answers
537
Sorting under restriction
Array of n elements with first 10 and last 50 elements unsorted..find an algo which runs faster a)merge sort b)quick sort c)insertion sort d)bubble sort Explain
Array of n elements with first 10 and last 50 elements unsorted..find an algo which runs faster a)merge sort b)quick sort c)insertion sort d)bubble sort Explain
Bhagirathi
4.1k
views
Bhagirathi
asked
Sep 24, 2014
Algorithms
algorithms
sorting
normal
+
–
113
votes
9
answers
538
GATE CSE 2013 | Question: 30
The number of elements that can be sorted in $\Theta(\log n)$ time using heap sort is $\Theta(1)$ $\Theta(\sqrt{\log} n)$ $\Theta(\frac{\log n}{\log \log n})$ $\Theta(\log n)$
The number of elements that can be sorted in $\Theta(\log n)$ time using heap sort is$\Theta(1)$$\Theta(\sqrt{\log} n)$$\Theta(\frac{\log n}{\log \log n})$$\Theta(\log n)...
Arjun
28.3k
views
Arjun
asked
Sep 24, 2014
Algorithms
gatecse-2013
algorithms
sorting
normal
heap-sort
+
–
31
votes
3
answers
539
GATE CSE 1999 | Question: 8
Let $A$ be an $n \times n$ matrix such that the elements in each row and each column are arranged in ascending order. Draw a decision tree, which finds $1$st, $2$nd and $3$rd smallest elements in minimum number of comparisons.
Let $A$ be an $n \times n$ matrix such that the elements in each row and each column are arranged in ascending order. Draw a decision tree, which finds $1$st, $2$nd and $...
Kathleen
5.2k
views
Kathleen
asked
Sep 23, 2014
Algorithms
gate1999
algorithms
sorting
normal
descriptive
+
–
26
votes
2
answers
540
GATE CSE 1999 | Question: 1.12
A sorting technique is called stable if it takes $O (n \log n)$ time it maintains the relative order of occurrence of non-distinct elements it uses divide and conquer paradigm it takes $O(n)$ space
A sorting technique is called stable ifit takes $O (n \log n)$ timeit maintains the relative order of occurrence of non-distinct elementsit uses divide and conquer paradi...
Kathleen
9.3k
views
Kathleen
asked
Sep 23, 2014
Algorithms
gate1999
algorithms
sorting
easy
+
–
Page:
« prev
1
...
13
14
15
16
17
18
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register