GATE Overflow - Recent questions in Algorithms
https://gateoverflow.in/questions/algorithms
Powered by Question2Answerwhat is EZ battery reconditioning ?
https://gateoverflow.in/171117/what-is-ez-battery-reconditioning
<p><a rel="nofollow" href="file:///C:/Users/nitinkumarsapp/Desktop/EZ%20battery%20reconditioning%20">EZ battery reconditioning </a>is The most promoted affiliate systems with regard to the sector, and it’s been going For a few years now Producing and preserving pounds obtained by exclusive resources continues to be being a vital endeavor of every distinct individual today, and beneath Every and every modest And large preserving matters a great deal. Inside of your day by day survival you will uncover various stuffs that function by use of batteries, but these batteries must get replaced ideal just after actually restricted interval of your time and energy length.</p>
<p><a rel="nofollow" href="http://www.wellness786.com/ez-battery-reconditioning/">http://www.wellness786.com/ez-battery-reconditioning/</a></p>Algorithmshttps://gateoverflow.in/171117/what-is-ez-battery-reconditioningFri, 17 Nov 2017 09:10:36 +0000made easy test series
https://gateoverflow.in/171088/made-easy-test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=14468942154291362111"></p>Algorithmshttps://gateoverflow.in/171088/made-easy-test-seriesFri, 17 Nov 2017 07:43:18 +0000made easy test series
https://gateoverflow.in/171074/made-easy-test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=3271278863637520223"></p>Algorithmshttps://gateoverflow.in/171074/made-easy-test-seriesFri, 17 Nov 2017 07:14:40 +0000Which of the following is the possible sequence of edges when Prim's algorithm is applied ?
https://gateoverflow.in/171027/which-following-possible-sequence-edges-algorithm-applied
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=4206912258936946049"></p>
<ul>
<li>
<p>(a,b),(b,c),(a,d),(e,f),(d,g),(c,e)</p>
</li>
<li>
<p>(g,f),(f,c),(g,d),(c,e),(d,b),(d,a)</p>
</li>
<li>
<p>(c,f),(c,e),(e,d),(a,b),(d,g),(b,c)</p>
</li>
<li>
<p>None of the above</p>
</li>
</ul>Algorithmshttps://gateoverflow.in/171027/which-following-possible-sequence-edges-algorithm-appliedFri, 17 Nov 2017 05:11:00 +0000Huffman coding
https://gateoverflow.in/170987/huffman-coding
The following message is: <br />
GATE2018GAATTTEEEE22000011188<br />
What is the average length of bits required for encoding each letter using Huffman coding___?Algorithmshttps://gateoverflow.in/170987/huffman-codingFri, 17 Nov 2017 04:07:20 +0000Prims algorithm
https://gateoverflow.in/170983/prims-algorithm
<p>Consider the following graph and Assume node ‘P’ as the starting vertex for Prim’s algorithm. Which of the following can be the correct order of edges in which they are added to construct Minimum Spanning Tree (MST)?</p>
<p><img alt="image:n104.PNG" src="http://gatexcel.co.in/cache/n104.PNG"></p>
<ol>
<li>P-Q, P-X, X-V, V-U, U-R, R-S, R-W, S-T</li>
<li> P-Q, P-X, X-V, V-U, U-R, R-W, R-S, S-T</li>
<li> P-Q, Q-R, R-W, W-V, V-X, V-U, R-S, S-T</li>
<li> P-Q, Q-R, R-W, R-S, V-X, V-U, W-V, S-T</li>
</ol>Algorithmshttps://gateoverflow.in/170983/prims-algorithmFri, 17 Nov 2017 03:57:35 +0000Knapsack
https://gateoverflow.in/170978/knapsack
<p>The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack.
<br>
<img alt="image:n108.PNG" height="116" src="http://gatexcel.co.in/cache/n108.PNG" width="572"></p>
<ol>
<li> 90</li>
<li> 80.25</li>
<li> 85.50</li>
<li> 91.2</li>
</ol>Algorithmshttps://gateoverflow.in/170978/knapsackFri, 17 Nov 2017 03:48:37 +0000fibonacci
https://gateoverflow.in/170889/fibonacci
How fibonacci timecomplexity on dynamic approach and recursive approach is different<br />
<br />
Couldnt understand the algo properly <br />
<br />
If someone could help :)Algorithmshttps://gateoverflow.in/170889/fibonacciThu, 16 Nov 2017 17:01:54 +0000sorting
https://gateoverflow.in/170883/sorting
Sorting that will work best for powers of base nAlgorithmshttps://gateoverflow.in/170883/sortingThu, 16 Nov 2017 16:35:49 +0000TestSeries
https://gateoverflow.in/170882/testseries
<p>Can Bfs be applied for topological sort?<img alt="" height="41" src="https://gateoverflow.in/?qa=blob&qa_blobid=2252689176273478548" width="781"></p>Algorithmshttps://gateoverflow.in/170882/testseriesThu, 16 Nov 2017 16:35:34 +0000asymptotic notation
https://gateoverflow.in/170836/asymptotic-notation
if f(n)=n! then f(n)=O( )?Algorithmshttps://gateoverflow.in/170836/asymptotic-notationThu, 16 Nov 2017 14:52:43 +0000complexity
https://gateoverflow.in/170825/complexity
<p><strong>T(n) = T(sqrt(n)) + n</strong></p>
<p>Taking 2<sup>m</sup> = n we can convert this as </p>
<p>S(m/2) + 2<sup>m</sup></p>
<p>after this how to solve by masters?</p>
<p> </p>Algorithmshttps://gateoverflow.in/170825/complexityThu, 16 Nov 2017 14:32:11 +0000doubt regarding bridge
https://gateoverflow.in/170810/doubt-regarding-bridge
Whether we can find a bridge in a graph with the help of different types edges like forward edge, backward edge and cross edge?<br />
<br />
<br />
<br />
Please tell logic in algorithm.Algorithmshttps://gateoverflow.in/170810/doubt-regarding-bridgeThu, 16 Nov 2017 13:19:15 +0000back-substitution
https://gateoverflow.in/170777/back-substitution
T(n) = 1 + T(n-1) + T(n-2);<br />
<br />
Given T(0) = 1, T(1) = 2 ; T(2) = 4;<br />
<br />
Express T(n) in terms of n ?Algorithmshttps://gateoverflow.in/170777/back-substitutionThu, 16 Nov 2017 11:50:29 +0000Linked List
https://gateoverflow.in/170723/linked-list
<p>Here In this question it is given that we have to perform nlogn decrease key operation and n find operation .
<br>
1)Finding an element in the linked list itself takes O(n) and<strong> there are N such operations total=O(n<sup>2</sup>).</strong>
<br>
2)Decrease key: Find key O(n) + O(1) for decrease=O(n) and <strong>there are </strong><strong>nlogn</strong><strong> such operations: total O(n<sup>2</sup>logn).</strong>
<br>
Please correct Me :
<br>
Image :
<br>
<img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=5199462328538537463"></p>Algorithmshttps://gateoverflow.in/170723/linked-listThu, 16 Nov 2017 08:46:17 +0000Binary Search
https://gateoverflow.in/170721/binary-search
<p>In this given question <strong>I find all answers false </strong>because while implementing <strong>binary </strong><strong>seach</strong><strong> or tracing it for an example we need to follow same approach Right</strong>? if we are taking <strong>ceil for evaluation then it should be considered throughout and if we are taking floor accordingly it should be traced</strong>.Therefore applying both operating individually I find none of the options matching.
<br>
Correct Me If I am wrong here.
<br>
<img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=7194659928028060266" style="float:left"></p>Algorithmshttps://gateoverflow.in/170721/binary-searchThu, 16 Nov 2017 08:40:05 +0000Time complexity
https://gateoverflow.in/170711/time-complexity
T(n)=2T(n-1)-1 , for n>0<br />
<br />
1 , otherwise<br />
<br />
What is the time complexityAlgorithmshttps://gateoverflow.in/170711/time-complexityThu, 16 Nov 2017 08:01:44 +0000Time Complexity
https://gateoverflow.in/170550/time-complexity
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=13335910597480432700"></p>
<p>How to solve it using substitution method ?</p>Algorithmshttps://gateoverflow.in/170550/time-complexityWed, 15 Nov 2017 14:58:43 +0000NET-2017
https://gateoverflow.in/170398/net-2017
Use kruskal's algorithm to find a minimal spanning tree for the graph.the list of edges of the tree in the order in which they are chosen is ?<br />
<br />
(1)AD,AE,AG,GC,GB,BF<br />
<br />
(2)GC,GB,BF,GA,AD,AE<br />
<br />
(3)GC,AD,GB,GA,BF,AE<br />
<br />
(4)AD,AG,GC,AE,GB,BFAlgorithmshttps://gateoverflow.in/170398/net-2017Wed, 15 Nov 2017 06:19:55 +0000Asymptotic notations / time complexity
https://gateoverflow.in/170140/asymptotic-notations-time-complexity
<p><strong>int unknown(int n) {
<br>
inti, j, k = 0;
<br>
for (i = n/2; i<= n; i++)
<br>
for (j = 2; j <= n; j = j * 2)
<br>
k = k + n/2;
<br>
return k;
<br>
}</strong>
<br>
What is the returned value of the above function? (GATE CS 2013)
<br>
(a) Ѳ(n2) (b) Ѳ(n2 log n)
<br>
(c) Ѳ(n3) (d) Ѳ(n3 log n)</p>Algorithmshttps://gateoverflow.in/170140/asymptotic-notations-time-complexityTue, 14 Nov 2017 15:08:52 +0000Algo:- Small oh notataion
https://gateoverflow.in/170126/algo-small-oh-notataion
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=137800199201399648"></p>
<p>This is a snapshot from coreman.</p>
<p>Here if i want to prove this example</p>
<p>$2n^2$ = $o(n^2)$</p>
<p>And if i take c=3,</p>
<p>then </p>
<p>$2n^2$ < $3n^2$</p>
<p>Now for all n0 and c=3 it will hold and this will be true .I know this proof i gave is wrong.But what exactly is wrong ?</p>Algorithmshttps://gateoverflow.in/170126/algo-small-oh-notataionTue, 14 Nov 2017 13:58:35 +0000merge sort
https://gateoverflow.in/170107/merge-sort
Merge sort using linked list is better than array in terms of space complexity<br />
<br />
true or not with explanation :)Algorithmshttps://gateoverflow.in/170107/merge-sortTue, 14 Nov 2017 13:26:47 +0000hufmann
https://gateoverflow.in/170086/hufmann
<p>From huffmann encoding how will we find max and min number of comparisons? </p>
<p><img alt="" src="http://www.geeksforgeeks.org/wp-content/uploads/fig-6-300x167.jpg"></p>
<p>what will be the max and min comparisons here</p>Algorithmshttps://gateoverflow.in/170086/hufmannTue, 14 Nov 2017 12:52:12 +0000groowth rate
https://gateoverflow.in/169945/groowth-rate
<p>N log (N<sup>2</sup>)</p>
<p>N<sup>1.5</sup></p>
<p>which will grow faster</p>Algorithmshttps://gateoverflow.in/169945/groowth-rateTue, 14 Nov 2017 06:19:04 +0000huffman
https://gateoverflow.in/169937/huffman
<p>Let a language L be defined over a character set L= (a,b,c,d,e) . The probabilities of the characters are in the order 1/2<sup>L</sup></p>
<p>L=1,5 respectively for each character , the average number of bits per character using huffman coding is ___________(2 decimal places)</p>Algorithmshttps://gateoverflow.in/169937/huffmanTue, 14 Nov 2017 06:07:01 +0000time complexity
https://gateoverflow.in/169935/time-complexity
<p>Cosider n distinct integers , it is required to determine 3 smallest integers of this array by comparisons.The number of comparisons needed are</p>
<p>1.n+ O(logn)</p>
<p>2.n+O(1)</p>
<p>3.O(n)</p>
<p>4.O(log<sup>2</sup>n)</p>Algorithmshttps://gateoverflow.in/169935/time-complexityTue, 14 Nov 2017 05:59:51 +0000shortest path
https://gateoverflow.in/169932/shortest-path
<p>1)In an unweighted undirect connected graph , the shortest path from node S to every other node can be computed with the most efficient algo in time complexity of ____________assuming graph ha n vertices and e edges</p>
<p>O(n<sup>2</sup>)</p>
<p>O(n logn)</p>
<p>O(n+e)</p>
<p>O(n<sup>3</sup>)</p>
<p> </p>
<p> </p>
<p>2) Bellman ford shortest path finds whther any negative weighted cycle is reachable from source - true or not</p>Algorithmshttps://gateoverflow.in/169932/shortest-pathTue, 14 Nov 2017 05:49:31 +0000time complexity
https://gateoverflow.in/169929/time-complexity
<p>Consider the following functions for large values on n</p>
<p>f(n) = n<sup>1/root(logn)</sup></p>
<p>g(n)=root(logn)</p>
<p>h(n)=n<sup>1/100</sup></p>
<p>1.g(n)<f(n)<h(n)</p>
<p>2.g(n)<h(n)<f(n)</p>Algorithmshttps://gateoverflow.in/169929/time-complexityTue, 14 Nov 2017 05:42:49 +0000test series
https://gateoverflow.in/169847/test-series
given an unsorted array with n distinct elements with a property that every element can be atmost k distance from its original position . what is the worst case time complexity to get the sorted array.<br />
<br />
ans O(n log k)<br />
<br />
how .....Algorithmshttps://gateoverflow.in/169847/test-seriesMon, 13 Nov 2017 19:48:14 +0000test series
https://gateoverflow.in/169812/test-series
consider a set of n distinct numbers by comparison find the 3 largest numbers, <br />
<br />
which of the following is true<br />
<br />
1.3 largest elements can be found by O(log^2 n) comparisons.<br />
2.O(log^2 n) comparisons is not sufficient but 3 largest can be found in n comparisons.<br />
<br />
3.n+O(1) comparisons are needed for 3 largest elements.<br />
<br />
4.n+O(1) comparisons are not enough n+O(log n) comparisons are needed.Algorithmshttps://gateoverflow.in/169812/test-seriesMon, 13 Nov 2017 18:10:40 +0000Time complexity of algorithms
https://gateoverflow.in/169749/time-complexity-of-algorithms
<p>In an unweighted, undirected connected graph, the shortest path from a node S to every other node is computed most efficiently, in terms of time complexity by</p>
<table>
<thead>
<tr>
<th> </th>
<th> </th>
</tr>
</thead>
</table>
<table>
<thead>
<tr>
<th> </th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<td> </td>
<td>
<p>(A) Dijkstra's algorithm starting from S</p>
</td>
</tr>
<tr>
<td> </td>
<td>
<p>(B) Warshall's algorithm</p>
</td>
</tr>
<tr>
<td> </td>
<td>
<p>(C) performing a DFS starting from S</p>
</td>
</tr>
<tr>
<td> </td>
<td>
<p>(D) performing a BFS starting from S</p>
</td>
</tr>
</tbody>
</table>Algorithmshttps://gateoverflow.in/169749/time-complexity-of-algorithmsMon, 13 Nov 2017 16:40:39 +0000Huffman coding
https://gateoverflow.in/169681/huffman-coding
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=14045265800661300160"></p>Algorithmshttps://gateoverflow.in/169681/huffman-codingMon, 13 Nov 2017 12:59:02 +0000Number of comparisons
https://gateoverflow.in/169680/number-of-comparisons
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=4995295321372510363"></p>Algorithmshttps://gateoverflow.in/169680/number-of-comparisonsMon, 13 Nov 2017 12:58:13 +0000TestBook Test Series
https://gateoverflow.in/169561/testbook-test-series
there is a sorted array which is of very large. every element is repeated more than once except one element. how much time will it take to find the element?Algorithmshttps://gateoverflow.in/169561/testbook-test-seriesMon, 13 Nov 2017 06:44:14 +0000Time Complexity
https://gateoverflow.in/169286/time-complexity
<p>Which of the following statements is/are TRUE?
<br>
I. The time complexity of recurrence relation A(n) = 3A(n/2)+ n<sup>2</sup> is asymptotically faster than T(n) = 4T(n/2)+ n<sup>2</sup>.
<br>
<br>
II. The time complexity of recurrence relation A(n) = 512 A(n/2) + O(n<sup>50</sup>) is asymptotically faster than T(n) = 7T(n-53) + O(1), T(0) = 1.</p>
<p>Please explain what is mean by asymptotically faster?</p>Algorithmshttps://gateoverflow.in/169286/time-complexitySun, 12 Nov 2017 13:28:16 +0000Optimal binary search tree
https://gateoverflow.in/169188/optimal-binary-search-tree
Let n=4, and (a1,a2,a3,a4) =(do,if,int,while).<br />
<br />
Let p (1••••••4) = (3,3,1,1) and q ( 0••••4) =(2,3,1,1,1). If you construct optimal cost binary search tree then what is the cost of the optimal binary search tree? And which is the root in the optimal cost binary search tree?Algorithmshttps://gateoverflow.in/169188/optimal-binary-search-treeSun, 12 Nov 2017 08:44:23 +0000time complexity
https://gateoverflow.in/169044/time-complexity
<p>Determine the time complexity of the program segment given below:</p>
<pre>
<code>i= n;
while (i>0)
{
k=1;
for (j=1; j<=n; j+=k)
{
k++;
}
i= i/2;
}</code></pre>
<p>(A) O(n<sup>2</sup>)
<br>
(B) O(n.log n)
<br>
(C) O(log<sup>2</sup> n)
<br>
(D) O(log n√n)</p>Algorithmshttps://gateoverflow.in/169044/time-complexitySun, 12 Nov 2017 04:12:48 +0000Problem on TOH
https://gateoverflow.in/168966/problem-on-toh
We solve TOH problem recursively breaking the task in three sections, which of the following recurrence will accord well with the approach , that is shows correct order of work done on each recursive step<br />
<br />
A) T(n)=T(n-1)+1+T(n-1)<br />
<br />
B) T(n)=T(n-1)+T(n-1)+1<br />
<br />
C) T(n)=1+T(n-1)+T(n-1)<br />
<br />
D) T(n)=T(n-1)+T(n-1)+2Algorithmshttps://gateoverflow.in/168966/problem-on-tohSat, 11 Nov 2017 18:38:44 +0000Time complexity
https://gateoverflow.in/168938/time-complexity
Consider the following statements<br />
<br />
The best case complexity of insertion sort is $\Omega \left ( n^{2} \right )$<br />
<br />
The best case complexity of insertion sort is $O\left ( n \right )$<br />
<br />
Which one true?Algorithmshttps://gateoverflow.in/168938/time-complexitySat, 11 Nov 2017 17:37:00 +0000Algo Numerical
https://gateoverflow.in/168930/algo-numerical
Assume there are 1024 men, each of distinct arm strength, In an arm wrestling match stronger arm always wins. Number of arm wrestling match required to find men with strongest and second strongest arm in worst case is _________Algorithmshttps://gateoverflow.in/168930/algo-numericalSat, 11 Nov 2017 17:18:34 +0000made easy test series
https://gateoverflow.in/168928/made-easy-test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=389423672621473807"></p>Algorithmshttps://gateoverflow.in/168928/made-easy-test-seriesSat, 11 Nov 2017 17:10:07 +0000Combined 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 +0000Virtual Gate
https://gateoverflow.in/168859/virtual-gate
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=5102096500944701788"></p>Algorithmshttps://gateoverflow.in/168859/virtual-gateSat, 11 Nov 2017 14:58:53 +0000Space complexity
https://gateoverflow.in/168808/space-complexity
Worst case and best case space complexity of merge sort is ___________________________Algorithmshttps://gateoverflow.in/168808/space-complexitySat, 11 Nov 2017 12:40:09 +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 +0000GateForum
https://gateoverflow.in/168775/gateforum
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=707557735095966183"></p>Algorithmshttps://gateoverflow.in/168775/gateforumSat, 11 Nov 2017 11:26:54 +0000minimum spanning tree
https://gateoverflow.in/168648/minimum-spanning-tree
A complete graph G with 5 nodes has positive weight edge ,each node has distinct weight with an integer value and maximum weight is equal to the number of edges in G.What can be the maximum weight of minimum spanning tree for graph G?Algorithmshttps://gateoverflow.in/168648/minimum-spanning-treeSat, 11 Nov 2017 06:06:42 +0000greedy technique
https://gateoverflow.in/168645/greedy-technique
Assume coins with denominator 20,15,5 and 1 are available ,we are required to make a sum of 33,using minimum number of coins.Difference between answer using greedy technique and correct answer will be ____________Algorithmshttps://gateoverflow.in/168645/greedy-techniqueSat, 11 Nov 2017 05:58:50 +0000HEAP and its properties
https://gateoverflow.in/168532/heap-and-its-properties
Show that there are at most (n/2^h+1) nodes of height h in any n-element heap.Algorithmshttps://gateoverflow.in/168532/heap-and-its-propertiesFri, 10 Nov 2017 19:03:24 +0000Worst case running time of MAX_HEAPIFY
https://gateoverflow.in/168526/worst-case-running-time-of-max_heapify
<p>Show that the worst case time complexity of MAX_HEAPIFY is <strong>Ω(logn ) .</strong></p>Algorithmshttps://gateoverflow.in/168526/worst-case-running-time-of-max_heapifyFri, 10 Nov 2017 18:53:35 +0000