GATE Overflow - Recent questions tagged sorting
https://gateoverflow.in/tag/sorting
Powered by Question2AnswerCombined Sorting
https://gateoverflow.in/168920/combined-sorting
A cache aware sorting algorithm sorts an array of size $2^{k}$ with each key of size 4 Bytes. The size of cache memory 128 Bytes. and algorithm is a combination of merge sort and insertion sort to exploit locality of reference for the cache memory(i.e. will use insertion sort when problem size equal to cache memory)<br />
<br />
Worst case running time of this algo<br />
<br />
1)$2^{k}\left [ 2^{5}+log_{2}2^{k-5} \right ]$<br />
<br />
2)$2^{k-5}\left [ 2^{5}+log_{2}2^{k-5} \right ]$Algorithmshttps://gateoverflow.in/168920/combined-sortingSat, 11 Nov 2017 16:59:48 +0000Sorting
https://gateoverflow.in/168806/sorting
The minimum number of comparisons required to sort 25 elements is ____Algorithmshttps://gateoverflow.in/168806/sortingSat, 11 Nov 2017 12:39:41 +0000ugc net November 2017
https://gateoverflow.in/167384/ugc-net-november-2017
You are given a sequence of n elements to sort. The input sequence consist of n/k subsequences, each containing K elements. The elements in a given sequence are all smaller than the elements in the succeeding and larger than the elements in the preceding subsequence. Thus, all that is needed to sort the whole sequence of length n is to sort the k elements in each of the n/k subsequences . The lower bound on the number of comparisons needed to solve this variant of the sorting problem is:<br />
<br />
1. Omega (n)<br />
<br />
2. Omega (n/k)<br />
<br />
3. Omega (n lg k)<br />
<br />
4. Omega (n/k lg n/k)Algorithmshttps://gateoverflow.in/167384/ugc-net-november-2017Wed, 08 Nov 2017 05:36:54 +0000test series
https://gateoverflow.in/165980/test-series
To merge two lists of size m and n, how many comparisons we need to perform in the worst case and best case respectively ?<br />
<br />
a) m+n-1 and m+n-1<br />
<br />
b)m+n+1 and max(m,n)<br />
<br />
c)max(m,n) and min(m,n)<br />
<br />
d)m+n-1 and min(m,n)<br />
<br />
<br />
<br />
can someone give the worst case and best case with examples ?Algorithmshttps://gateoverflow.in/165980/test-seriesSat, 04 Nov 2017 17:14:55 +0000In-place Merge Sort via Doubly linked list in place of Array
https://gateoverflow.in/165344/in-place-merge-sort-via-doubly-linked-list-in-place-of-array
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our merge procedure will take O($n^2$) time. so overall complexity will become O($n^2\log_2 n $).<br />
<br />
But can not we do it In-place in O($n \log n $), using a doubly linked list in place of Array (for storing and merging data) ?<br />
<br />
Please share your valuable opinion. It will be great help.Algorithmshttps://gateoverflow.in/165344/in-place-merge-sort-via-doubly-linked-list-in-place-of-arrayThu, 02 Nov 2017 19:18:43 +0000Sorting
https://gateoverflow.in/163862/sorting
If we are asked to find best comparison based sorting algorithm to sort n numbers having d digit's and in the range from [1-k].<br />
<br />
If I say it is quick sort or merge sort or heap sort is it wrong ?<br />
<br />
OR in general we do sorting on these type of numbers using Radix sort only ?Algorithmshttps://gateoverflow.in/163862/sortingSun, 29 Oct 2017 12:33:26 +0000MERGE SORT
https://gateoverflow.in/163617/merge-sort
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the list we have to take 5-5 elements from bottom to up for merging.<br />
<br />
if I am wrong please let me correct!Algorithmshttps://gateoverflow.in/163617/merge-sortSat, 28 Oct 2017 16:56:39 +0000Modified form of GATE1996_2.15
https://gateoverflow.in/161097/modified-form-of-gate1996_2-15
<p>Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot</p>
<p>i) 1,2,3,…<em>n</em></p>
<p>ii)<em> n</em>,<em>n</em>−1,<em>n</em>−2,…,2,1</p>
<p>Let <em>S</em>1 and <em>S</em>2 be the number of swaps made for the inputs (i) and (ii) respectively. Then,</p>
<p><strong>i) How is S1 and S2 related ?</strong></p>
<p><strong>ii) How will the answer change if the pivot is changed to middle element ?</strong></p>Algorithmshttps://gateoverflow.in/161097/modified-form-of-gate1996_2-15Wed, 18 Oct 2017 13:59:02 +0000Merge sort
https://gateoverflow.in/158972/merge-sort
True or False<br />
<br />
Merge sort on Linked list takes O(nlogn)DShttps://gateoverflow.in/158972/merge-sortTue, 10 Oct 2017 09:37:12 +0000QUICKSORT
https://gateoverflow.in/155660/quicksort
Could anyone describe how the partitioning algorithm vary when the pivot is varied ?<br />
<br />
In Cormen , last element is taken as pivot . Suppose I took first element or middle element or 3 rd element as pivot then how the partitioning algorithm will change.Algorithmshttps://gateoverflow.in/155660/quicksortWed, 27 Sep 2017 14:45:13 +0000Algorithm: Selection Sort
https://gateoverflow.in/154765/algorithm-selection-sort
<p>Consider the following code which sort all elements of an array ‘A’ in descending order.
<br>
<img alt="" height="292" src="https://gateoverflow.in/?qa=blob&qa_blobid=134279012405674346" width="337"></p>
<p>Which of the following will represents correct value of X, Y, Z in above code for selection sort?
<br>
a. i > 0, K > 0, a[K] > a[max]</p>
<p>b. i > 0, K < 0, a[K] < a[max]</p>
<p>c. i < 0, K > 0, a[K] > a[max]</p>
<p>d. i > 0, K > 0, a[K] < a[max]
<br>
</p>
<p>Answer is a</p>
<p>I think answer should be d. As it is given in the question that this algorithm will sort all the element of the array in the descending order but by using option a it is aranging in ascending order.</p>
<p>And option D is doing what question is saying.</p>Algorithmshttps://gateoverflow.in/154765/algorithm-selection-sortSun, 24 Sep 2017 10:35:04 +0000Bucket sort
https://gateoverflow.in/154150/bucket-sort
1. Is bucket sort always stable or does it depend on the sorting subroutine used by bucket sort toe sort the buckets?<br />
<br />
2. Bucket sort is always NOT inplace.Is this correct?Algorithmshttps://gateoverflow.in/154150/bucket-sortFri, 22 Sep 2017 06:41:45 +0000arrange the sorting algorithms ascending wise
https://gateoverflow.in/151511/arrange-the-sorting-algorithms-ascending-wise
What is the ascending wise order of sorting algorithms which takes least time and least space to sort the elements?Programminghttps://gateoverflow.in/151511/arrange-the-sorting-algorithms-ascending-wiseTue, 12 Sep 2017 05:11:14 +0000Quick Sort
https://gateoverflow.in/149631/quick-sort
"Quick sort has good cache performance" , Can anyone explain this statement.How is cache related to quick sort.I searched for this over the internet but could not find a good article.Algorithmshttps://gateoverflow.in/149631/quick-sortSun, 03 Sep 2017 18:24:08 +0000Sorted List
https://gateoverflow.in/146006/sorted-list
suppose there are 4 sorted lists of n/4 elements each. if we merge these list into a single sorted list of n elements, for the n=400 number of key comparisons in the worst case using an efficient algorithm isAlgorithmshttps://gateoverflow.in/146006/sorted-listMon, 21 Aug 2017 08:22:39 +0000Quick sort
https://gateoverflow.in/143135/quick-sort
When array is already sorted in reverse order then what will be the recurrence relation for number of swaps on array of n elements using quick sort?Algorithmshttps://gateoverflow.in/143135/quick-sortThu, 10 Aug 2017 19:31:22 +0000Sorting: A comparison between sorting Algos
https://gateoverflow.in/140940/sorting-a-comparison-between-sorting-algos
When an array is to be sorted, It may happen that some data values start out being in the same position where they should end up. For example in the array which is originally {40, -1, 33, 0} 33 is right where it will be in the final sorted output: {-1, 0, 33, 40} But as a particular sorting algorithm operates, it might (depending on the algorithm) move such an element out of the position where it belongs (of course, it will eventually get moved back) which of the following statements are true:<br />
i. Merge Sort never (even temporarily) moves such an element<br />
ii. Quick Sort never (even temporarily) moves such an element<br />
iii. Selection Sort never (even temporarily) moves such an element<br />
<br />
(a) ii only (b) i & iii (c) i & ii (d) ii & iiiAlgorithmshttps://gateoverflow.in/140940/sorting-a-comparison-between-sorting-algosTue, 01 Aug 2017 03:51:44 +0000number of movements in Insertion sort
https://gateoverflow.in/138625/number-of-movements-in-insertion-sort
will A[i+1]=key; in the insertion sort be counted as a movement in best case?Algorithmshttps://gateoverflow.in/138625/number-of-movements-in-insertion-sortWed, 19 Jul 2017 04:59:14 +0000Merge Sort Comparisons
https://gateoverflow.in/134008/merge-sort-comparisons
<p>Q . In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared?</p>
<p>a)2</p>
<p>b)logn</p>
<p>c)n-1</p>
<p>d)NOT</p>
<p><strong>My doubt is here ,Are we considering a specific Item throughout our Analysis.?</strong></p>Algorithmshttps://gateoverflow.in/134008/merge-sort-comparisonsTue, 20 Jun 2017 12:25:51 +0000Self doubt
https://gateoverflow.in/132047/self-doubt
You are asked to sort 15 randomly generated numbers. One should prefer—<br />
<br />
(a) Bubble sort (b) Quick sort (c) Merge sort (d) Heap sort<br />
<br />
I think the answer should be c or d <br />
<br />
crct me???Algorithmshttps://gateoverflow.in/132047/self-doubtTue, 06 Jun 2017 05:32:15 +0000Sorting
https://gateoverflow.in/131854/sorting
We need to sort 7 numbers each of 4 digits. What is the number of comparisons in worst case . Options are as follows:<br />
<br />
1) 40<br />
2) 38<br />
3) 47<br />
4) 280DShttps://gateoverflow.in/131854/sortingSun, 04 Jun 2017 13:01:43 +0000Sorting and Searching
https://gateoverflow.in/130947/sorting-and-searching
<p>l<img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=16456933111546705855"></p>
<p>This question is from the gateforum test series.</p>
<p>The answer is O(nlogn) but i think the same task can also be achived in O(n) time.</p>
<p> </p>Algorithmshttps://gateoverflow.in/130947/sorting-and-searchingFri, 26 May 2017 17:18:21 +0000Quick sort algorithm selects (n/5)th element as the smallest element
https://gateoverflow.in/129175/quick-sort-algorithm-selects-element-the-smallest-element
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=4679995202250465747"></p>
<p>Please show the working</p>Algorithmshttps://gateoverflow.in/129175/quick-sort-algorithm-selects-element-the-smallest-elementWed, 10 May 2017 13:14:07 +0000Each row and column of a matrix is sorted find the position of any given element
https://gateoverflow.in/129172/each-row-and-column-matrix-sorted-find-position-given-element
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=4830607782999800986"></p>
<p>please show the working</p>Algorithmshttps://gateoverflow.in/129172/each-row-and-column-matrix-sorted-find-position-given-elementWed, 10 May 2017 13:01:08 +0000ISRO2017-49
https://gateoverflow.in/128694/isro2017-49
<p>The number of swappings needed to sort the numbers 8 , 22, 7, 9, 31, 5, 13 in ascending order using bubble sort is</p>
<ol style="list-style-type: upper-alpha;">
<li>11</li>
<li>12</li>
<li>13</li>
<li>10</li>
</ol>Algorithmshttps://gateoverflow.in/128694/isro2017-49Sun, 07 May 2017 20:47:38 +0000ISRO2017-15
https://gateoverflow.in/128545/isro2017-15
<p>Which one of the following in-place sorting algorithms needs the minimum number of swaps?</p>
<ol style="list-style-type: upper-alpha;">
<li>Insertion Sort</li>
<li>Quick Sort</li>
<li>Heap Sort</li>
<li>Selection Sort</li>
</ol>Algorithmshttps://gateoverflow.in/128545/isro2017-15Sun, 07 May 2017 16:43:06 +0000Selection sort and Insertion sort
https://gateoverflow.in/127129/selection-sort-and-insertion-sort
Selection sort is an example of ____(I)_______ and insertion sort is an example of __(II)______.<br />
<br />
a) I- Greedy, II- Brute Force<br />
<br />
b) I- Brute Force II- Divide and conquer<br />
<br />
c) I- Greedy II- Divide and conquer<br />
<br />
d) I- Brute Force II- Brute ForceAlgorithmshttps://gateoverflow.in/127129/selection-sort-and-insertion-sortThu, 27 Apr 2017 17:07:18 +0000Complexity
https://gateoverflow.in/127073/complexity
We have for Counting Sort, O(n+k), for a simple uniform hashing, search operation of O(1+alpha) etc. What is the meaning when we say n + k? Is it that counting sort will depend on either n or k? Because there are separate loops in counting sort running on O(n) and O(k) separately. What does O(n + k) mean? What kind of algorithms have this summation for their order, generally?Algorithmshttps://gateoverflow.in/127073/complexityThu, 27 Apr 2017 08:35:44 +0000Sorting
https://gateoverflow.in/126753/sorting
Which sorting algorithim is best if<br />
<br />
exhactly only half of the elements are in correct position ?Othershttps://gateoverflow.in/126753/sortingMon, 24 Apr 2017 00:17:10 +0000Which sorting algorithm can be used to sort a random linked list with minimum time complexity ?
https://gateoverflow.in/126646/which-sorting-algorithm-random-linked-minimum-complexity
Which sorting algorithm can be used to sort a random linked list with minimum time complexity ?<br />
<br />
A)mergesort<br />
<br />
B)quicksort<br />
<br />
C)radixsort<br />
<br />
D)insertionsort<br />
<br />
E)heapsortAlgorithmshttps://gateoverflow.in/126646/which-sorting-algorithm-random-linked-minimum-complexitySun, 23 Apr 2017 12:52:59 +0000With quick sort The results after first partioning of the given array
https://gateoverflow.in/125609/with-quick-sort-results-after-first-partioning-given-array
With quick sort The results after first partioning of the given array. <br />
<br />
A = (2,8,7,1,3,5,6,4,9).<br />
<br />
Analysis the time complexity of Quick sort in the best case.Algorithmshttps://gateoverflow.in/125609/with-quick-sort-results-after-first-partioning-given-arraySat, 15 Apr 2017 09:25:23 +0000GATE 2008 Quick Sort
https://gateoverflow.in/122868/gate-2008-quick-sort
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— <br />
A. T(n) <= 2T(n/5) + n <br />
<br />
B. T(n) <= T(n/5) + T(4n/5) + n<br />
<br />
C. T(n) <= 2T(4n/5) + n <br />
<br />
D. T(n) <= 2T(n/2) + n <br />
<br />
<br />
The Answer to this question is B. My doubt is that why can't the answer be C? My logic is that if there are (n/5) elements on one side and (4n/5) on the other, then T(n)= T(n/5) + T(4n/5) + n. Here, 4n/5 > n/5 so definitely, time taken will be less than 2T(4n/5) + n, if elements are more than (n/5)( since it is given 'AT LEAST').<br />
<br />
Where am I going wrong?Algorithmshttps://gateoverflow.in/122868/gate-2008-quick-sortWed, 29 Mar 2017 14:48:07 +0000algorithm, Sorting
https://gateoverflow.in/120851/algorithm-sorting
which sorting algorihm is used if we have a telephone directory wit 1,00,000 entries ?Algorithmshttps://gateoverflow.in/120851/algorithm-sortingTue, 07 Mar 2017 21:14:26 +0000Space complexity
https://gateoverflow.in/116315/space-complexity
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.<br />
<br />
A)insertion sort<br />
<br />
B)quick sort<br />
<br />
C)merge sort<br />
<br />
D)selection sortProgramminghttps://gateoverflow.in/116315/space-complexitySun, 05 Feb 2017 22:04:02 +0000#algorithms #best #algo
https://gateoverflow.in/115346/%23algorithms-%23best-%23algo
<p><strong>Best algorithm for this set:</strong></p>
<p><strong>1.</strong>Independently sorting each of 1,000,000 arrays, each with 5 elements.</p>
<p><strong>2.</strong>Sorting a set of 4,000,000 numbers in worst case O(n lg n) time.</p>Algorithmshttps://gateoverflow.in/115346/%23algorithms-%23best-%23algoFri, 03 Feb 2017 19:25:25 +0000Sorting Techniques
https://gateoverflow.in/111953/sorting-techniques
<p>What is the best sorting algorithm to use for the elements in array are more than 1 million in general?</p>
<table>
<tbody>
<tr>
<td>
<p>A</p>
</td>
<td>
<p>Merge sort.</p>
</td>
</tr>
<tr>
<td>
<p>B</p>
</td>
<td>
<p>Bubble sort.</p>
</td>
</tr>
<tr>
<td>C</td>
<td>
<p>Quick sort.</p>
</td>
</tr>
<tr>
<td>
<p>D</p>
</td>
<td>
<p>Insertion sort.</p>
</td>
</tr>
</tbody>
</table>
<p> Ans:C</p>
<p>Source: <a rel="nofollow" href="http://quiz.geeksforgeeks.org/algorithms-insertionsort-question-6/">http://quiz.geeksforgeeks.org/algorithms-insertionsort-question-6/</a></p>
<p>You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?</p>
<table>
<tbody>
<tr>
<td>
<p>A</p>
</td>
<td>
<p>Heap sort</p>
</td>
</tr>
<tr>
<td>B</td>
<td>
<p>Merge sort</p>
</td>
</tr>
<tr>
<td>C</td>
<td>
<p>Quick sort</p>
</td>
</tr>
<tr>
<td>
<p>D</p>
</td>
<td>
<p>Insertion sort</p>
</td>
</tr>
</tbody>
</table>
<p>Ans: B</p>
<p>Source: <a rel="nofollow" href="http://quiz.geeksforgeeks.org/algorithms-searching-and-sorting-question-16/">http://quiz.geeksforgeeks.org/algorithms-searching-and-sorting-question-16/</a></p>
<p>Kindly explain on why the answers are different?</p>
<p> </p>Algorithmshttps://gateoverflow.in/111953/sorting-techniquesFri, 27 Jan 2017 18:40:35 +0000Insertion sort
https://gateoverflow.in/111884/insertion-sort
<p>Consider the array A[]= {6,4,8,1,3} apply the insertion sort to sort the array . Consider the cost associated with each sort is 25 rupees , what is the total cost of the insertion sort when element 1 reaches the first position of the array ?
<br>
<strong>(A)</strong> 50
<br>
<strong>(B)</strong> 25
<br>
<strong>(C)</strong> 75
<br>
<strong>(D)</strong> 100</p>
<p>Source: <a rel="nofollow" href="http://quiz.geeksforgeeks.org/algorithms-insertionsort-question-4/">http://quiz.geeksforgeeks.org/algorithms-insertionsort-question-4/</a></p>Algorithmshttps://gateoverflow.in/111884/insertion-sortFri, 27 Jan 2017 16:18:39 +0000quick sort
https://gateoverflow.in/108311/quick-sort
If we use quicksort algorithm to sort the elements: $16, 13, 14, 12, 21, 16, 23$ and $15$ in ascending order, what is the output after the first pass of quicksort? (Assume pivot element is beginning of an array)Algorithmshttps://gateoverflow.in/108311/quick-sortFri, 20 Jan 2017 17:35:06 +0000merge sort
https://gateoverflow.in/106042/merge-sort
<p><img alt="" height="30" src="https://gateoverflow.in/?qa=blob&qa_blobid=12449262815565518467" width="662"></p>Programminghttps://gateoverflow.in/106042/merge-sortSun, 15 Jan 2017 23:44:49 +0000Can anyone make the table of Complexities, No. of swaps required for N elements for all type of sorts?
https://gateoverflow.in/105123/anyone-make-table-complexities-swaps-required-elements-sorts
If possible,. all 3 cases (best,average, worst)Algorithmshttps://gateoverflow.in/105123/anyone-make-table-complexities-swaps-required-elements-sortsFri, 13 Jan 2017 19:42:46 +0000General doubt on calculating the Time complexity for the given Insertion Sort Algorithm in the worst and average case
https://gateoverflow.in/104638/general-calculating-complexity-insertion-algorithm-average
INSERTION-SORT (A, n) ⊳ A[1 . . n]<br />
<br />
for (j ← 2 to len(A) )<br />
<br />
{<br />
<br />
key ← A[ j];<br />
<br />
i ← j – 1 ;<br />
<br />
while (i > 0 and A[i] > key)<br />
<br />
{<br />
<br />
A[i+1] ← A[i];<br />
<br />
i ← i – 1;<br />
<br />
}<br />
<br />
A[i+1] = key;Algorithmshttps://gateoverflow.in/104638/general-calculating-complexity-insertion-algorithm-averageThu, 12 Jan 2017 20:54:48 +0000Consider the array of size n. the first (n – 1) elements are already sorted.
https://gateoverflow.in/97360/consider-the-array-size-the-first-elements-are-already-sorted
<p>Consider the array of size n. the first (n – 1) elements are already sorted. What is the worst case time complexity to insert a n<sup>th</sup> element in an array after insertion the array should be in sorted order</p>
<ol>
<li> O(1)</li>
<li> O(n)</li>
<li> O(n log n)</li>
<li> O(n<sup>2</sup>)</li>
</ol>Algorithmshttps://gateoverflow.in/97360/consider-the-array-size-the-first-elements-are-already-sortedTue, 27 Dec 2016 16:43:21 +0000Consider an array ‘A’ with 2m elements. The elements in odd position are sorted in non-increasing order that
https://gateoverflow.in/96981/consider-array-elements-elements-position-sorted-increasing
<p>Consider an array ‘A’ with 2m elements. The elements in odd position are sorted in non-increasing order that is A[1] >= A[3] >= A[5]......A[2m-1] The elements in even position are sorted in non-decreasing order, that is A[2]<= A[4] <= A[6].....A[2m]. Which of the following method is recommended for finding if a given number is in array?</p>
<ol>
<li> Sort the given array using quick sort and then apply binary search on array.</li>
<li> Merge the sorted lists and apply binary search.</li>
<li> Apply binary search on the entire array.</li>
<li> Separately apply binary search on the odd position elements and even position elements</li>
</ol>
<p>i thought answer would be B,cuz then O(n) time will be taken but answer is D.how can we apply binary search on odd and even seperatly..pls guide me</p>DShttps://gateoverflow.in/96981/consider-array-elements-elements-position-sorted-increasingMon, 26 Dec 2016 18:21:52 +0000Algorithm || Minimum comparison sorting
https://gateoverflow.in/95725/algorithm-minimum-comparison-sorting
The lower bound on the no. of comparisons required to sort n numbers is __________ ?Algorithmshttps://gateoverflow.in/95725/algorithm-minimum-comparison-sortingFri, 23 Dec 2016 13:09:29 +0000TIFR2017-B-7
https://gateoverflow.in/95699/tifr2017-b-7
<p>An array of $n$ distinct elements is said to be un-sorted if for every index $i$ such that $ 2 \leq i \leq n-1$, either $A[i] > max \{A [i-1], A[i+1]\}$, or $A[i] < min \{A[i-1], A[i+1]\}$. What is the time-complexity of the fastest algorithm that takes as input a sorted array $A$ with $n$ distinct elements, and un-sorts $A$?</p>
<ol style="list-style-type:upper-alpha">
<li>$O(n \: \log \: n)$ but not $O(n)$</li>
<li>$O(n)$ but not $O(\sqrt{n})$</li>
<li>$O(\sqrt{n})$ but not $O(\log n)$</li>
<li>$O(\log n)$ but not $O(1)$</li>
<li>$O(1)$</li>
</ol>Algorithmshttps://gateoverflow.in/95699/tifr2017-b-7Fri, 23 Dec 2016 12:34:52 +0000No of comparisons
https://gateoverflow.in/94013/no-of-comparisons
<p> </p>
<p><strong>Q.15 </strong>An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the no. of comparisons needed?</p>
<p>(a) Atleast 2n-C comparisons are needed</p>
<p>(b) Atmost 1.5n-2 comparisons are needed</p>
<p>(c) Atleast nlog2 n comparisons are needed</p>
<p>(d) None of the above
<br>
</p>Algorithmshttps://gateoverflow.in/94013/no-of-comparisonsSun, 18 Dec 2016 15:56:20 +0000Insertion Sort
https://gateoverflow.in/93491/insertion-sort
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=15204843316127221747"></p>Algorithmshttps://gateoverflow.in/93491/insertion-sortFri, 16 Dec 2016 23:20:38 +0000Bucket Sort
https://gateoverflow.in/91825/bucket-sort
Does Bucket sort input is always between 0 and 1?<br />
<br />
Or the input has to be distributed between [0,1) interval uniformly before applying bucket sort?Algorithmshttps://gateoverflow.in/91825/bucket-sortSun, 11 Dec 2016 22:39:23 +0000GATE1988-1iii
https://gateoverflow.in/91338/gate1988-1iii
Quicksort is ________ efficient than heapsort in the worst case.Algorithmshttps://gateoverflow.in/91338/gate1988-1iiiSat, 10 Dec 2016 12:50:44 +0000sorting
https://gateoverflow.in/91087/sorting
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=1329386055046055369"></p>Algorithmshttps://gateoverflow.in/91087/sortingFri, 09 Dec 2016 15:54:04 +0000