GATE Overflow - Recent questions and answers in Algorithms
http://gateoverflow.in/qa/algorithms
Powered by Question2AnswerAnswered: Algorithms
http://gateoverflow.in/129822/algorithms?show=130481#a130481
here for the bucket sort it takes O(n2) in worst case but the quick sort takes O(n2) and merge sort takes O(n log n) but the radix sort takes O(n)for small elements and for larger digits it takes O(nlogn)<br />
<br />
so as(1-100) are have small digit value radix sort is best with O(n) and quicksort takes O(nlogn) small inputs<br />
<br />
for(0 to 1000000 integers ) merge is best<br />
<br />
with the given options we can go for (i)quick sort (ii)merge sort <br />
<br />
finally ANS:- is option (c) (i)quick sort (ii)merge sortAlgorithmshttp://gateoverflow.in/129822/algorithms?show=130481#a130481Mon, 22 May 2017 16:51:03 +0000Answered: T(n) =T(n^(1/2))+1
http://gateoverflow.in/130426/t-n-t-n-1-2-1?show=130445#a130445
<p>T(n) = T(sqrt n) +1</p>
<p>let n = 2<sup>m </sup>.........................(1)</p>
<p>T(2<sup>m</sup>) = T(2<sup>m/2</sup>) + 1</p>
<p>assume T(2<sup>m</sup>) = S(m)</p>
<p>so S(m) = S(m/2) + 1</p>
<p>apply master theorem</p>
<p>S(m) = theeta (log m)</p>
<p>from (1)</p>
<p>so T(n) = theeta (log log n) </p>
<p> </p>Algorithmshttp://gateoverflow.in/130426/t-n-t-n-1-2-1?show=130445#a130445Mon, 22 May 2017 14:05:34 +0000Answered: What would be Huffman coding for :
http://gateoverflow.in/130356/what-would-be-huffman-coding-for?show=130369#a130369
<p>Well, it seems like an easy one, but then the problem that arises here is that while solving the question, two nodes (subsequently) have same value ( 4 and 1 + 3 = 4). The challenge comes here.</p>
<p>So, after referring to the algorithms and the link (below, at the end), I got to the conclusion that <strong>when two nodes have same value, then choose the one you placed later in the queue</strong> (priority queue i.e min heap) <strong>as the node to be kept on left side.</strong></p>
<p>For example, in the question, we add two nodes t + o = 1 + 3 = $4$ and place this result back into the queue (auto reordered as min heap rebuilt). Now, in queue, we have $u$ with $4$ and the sum of two nodes (t + o) also with value $4$. We had added t + o = $4$ later in the queue. So, we would place this on the left side in the tree. </p>
<p>Rest of the problem is same as any other Huffman coding problem</p>
<p>Here is the tree for the answer</p>
<p style="text-align:center"><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=7390218049619742918"></p>
<p>And here is the table</p>
<pre>
Symbol Encoding
l 01
s 10
i 11
a 000
u 0010
o 00110
t 00111</pre>
<p> </p>
<p><strong>References</strong></p>
<p>For algorithm: <a rel="nofollow" href="http://www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding/">http://www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding/</a></p>
<p>For result verification: <a rel="nofollow" href="https://planetcalc.com/2481/">https://planetcalc.com/2481/</a></p>Algorithmshttp://gateoverflow.in/130356/what-would-be-huffman-coding-for?show=130369#a130369Mon, 22 May 2017 02:58:23 +0000Answered: GATE2007-45
http://gateoverflow.in/1243/gate2007-45?show=130299#a130299
<p><a rel="nofollow" href="https://gateoverflow.in/1243/gate2007-45">https://gateoverflow.in/1243/gate2007-45</a></p>Algorithmshttp://gateoverflow.in/1243/gate2007-45?show=130299#a130299Sun, 21 May 2017 06:35:49 +0000What is the value of the following recurrence?
http://gateoverflow.in/130272/what-is-the-value-of-the-following-recurrence
T(n) = 3T(n/5) + lgn * lgnAlgorithmshttp://gateoverflow.in/130272/what-is-the-value-of-the-following-recurrenceSat, 20 May 2017 18:31:11 +0000What is the value of the following recurrences?
http://gateoverflow.in/130267/what-is-the-value-of-the-following-recurrences
<p>1 :- T(n) = T(n-2) + n<sup>2</sup></p>
<p>2 :- T(n) = 4T(n/3) + nlgn</p>
<p>3 :- T(n) = 3T(n/3 - 2) + n/2</p>
<p> </p>Algorithmshttp://gateoverflow.in/130267/what-is-the-value-of-the-following-recurrencesSat, 20 May 2017 17:59:09 +0000Answered: binary search
http://gateoverflow.in/121046/binary-search?show=130259#a130259
<h1>Linear search is possible.</h1>
<h2>To solve it from binary search</h2>
<p>1. It is the same case when we are applying binary search for an absent element in a sorted array.</p>
<p>2. Here difference is we have to search a *.</p>
<p>3. Solve it by recursion. Find the mid point by low+high/2. If mid point = any number then make low=mid point. And if mid point= * then make high=mid point.</p>
<p>Function (low,high,array[ ])</p>
<p>T(n)=T(n/2)+1</p>
<p>4. In ever recursion check if(high=low+1) then index of first * is index of high.</p>
<h3>Complexity <em>O(logn)</em></h3>Algorithmshttp://gateoverflow.in/121046/binary-search?show=130259#a130259Sat, 20 May 2017 16:15:26 +0000Answered: Ace practice book
http://gateoverflow.in/130113/ace-practice-book?show=130114#a130114
<p>here we can not apply <strong>Master theorem</strong></p>
<p>if any recurrence relation is the form of</p>
<p>T(n) = a T(n/b) + f(n)</p>
<p>where a and b should be +ve constant and a ≥ 1,b >1</p>
<p>and f(n) be +ve function</p>
<p> </p>
<p> </p>Algorithmshttp://gateoverflow.in/130113/ace-practice-book?show=130114#a130114Fri, 19 May 2017 01:44:53 +0000Longest Common Subsequence
http://gateoverflow.in/130035/longest-common-subsequence
For finding longest common subsequence(LCS), standard sources mention that the recursive procedure consisting of the recursive tree occupies O(m+n) space( WITHOUT applying Dynamic Programming). I am unable to understand why is space occupied O(m+n)?<br />
<br />
Consider the tree of LCS(3,3). Won't the tree height( which is equal to the height of recursion stack and hence space occupied) be equivalent to log of (m+n), as in, the sequence can be evaluated as 2^0+2^1^2^2+...................2^k(worst case) where k will be the number of levels. So, the value of2^ k = O(m+n) and hence, space should be k=log(m+n).<br />
<br />
What's wrong with my logic?Algorithmshttp://gateoverflow.in/130035/longest-common-subsequenceWed, 17 May 2017 19:50:30 +0000Answered: What's an item in C
http://gateoverflow.in/129935/whats-an-item-in-c?show=130016#a130016
Item means anything that you can put in the stack.it can be a variableAlgorithmshttp://gateoverflow.in/129935/whats-an-item-in-c?show=130016#a130016Wed, 17 May 2017 16:38:48 +0000Answered: Algorithms
http://gateoverflow.in/129818/algorithms?show=129879#a129879
since it is asking for maximum difference in height of any 2 nodes of AVL...<br />
<br />
consider root node and one of the leaf node..<br />
<br />
difference will be 'O(log n)'..<br />
<br />
if it has been asked about difference in height of left and right subtree then it would be '1'...Algorithmshttp://gateoverflow.in/129818/algorithms?show=129879#a129879Mon, 15 May 2017 13:48:17 +0000Answered: recursive equation doubt
http://gateoverflow.in/129868/recursive-equation-doubt?show=129869#a129869
See, write 2 terms------------------ 2^1+2^2 -----------------------(a)<br />
<br />
now write 3 terms------------------- 2^1+2^2+2^3 -----------------------(b)<br />
<br />
NOw,write n terms------------------ 2^1+2^2+2^3.......+2^n ---------------------- (c) <br />
<br />
See, <br />
<br />
IF i ask, how many terms for equation (a),you will say 2 terms.<br />
<br />
IF i ask, how many terms for equation (b),you will say 3 terms.<br />
<br />
IF i ask, how many terms for equation (c),you will say n terms. <br />
<br />
NOW IN equation C add one more term 2^0,it will be (n+1) terms<br />
<br />
I hope its clear now.Algorithmshttp://gateoverflow.in/129868/recursive-equation-doubt?show=129869#a129869Mon, 15 May 2017 13:00:45 +0000Answered: Doubt
http://gateoverflow.in/129833/doubt?show=129835#a129835
In regular merge sort array is recursively get divide until single element is obtained. From there we pick the each element and sort them(which is kinda obvious single element is already sorted). Then we obtain two elements arraya and compare and merge them.<br />
<br />
<br />
<br />
2-way merge sort we take 2 elements at a time instead of 1 from the point we have divided the array to singleton element.<br />
<br />
<br />
<br />
8-7-6-5-4-3-2-1<br />
<br />
{8,7}-{6,5}-{4,3}-{2,1}// see pick two elements at a time now sort them<br />
<br />
{7,8}-{5,6}-{3,4}-{1,2} // again pick two sorted elements and merge them then sort<br />
<br />
{7,8,5,6}-{3,4,1,2}// sort them<br />
<br />
{5,6,7,8}-{1,2,3,4} // again we obtain sorted elements now again merge<br />
<br />
{5,6,7,8,1,2,3,4} // now sort them again<br />
<br />
{1,2,3,4,5,6,7,8} // sorted using 2-way merge sort.<br />
<br />
<br />
<br />
Hope you get the difference.<br />
<br />
It is just same after second step of regular merge sort.Algorithmshttp://gateoverflow.in/129833/doubt?show=129835#a129835Mon, 15 May 2017 03:31:05 +0000Answered: nptel exam ada
http://gateoverflow.in/129538/nptel-exam-ada?show=129545#a129545
δ<=2e/v<=Δ..hence,<br />
<br />
Δ>=2e/v<br />
<br />
3>=2*1225/v<br />
<br />
v>=2*1225/3<br />
<br />
v>=817Algorithmshttp://gateoverflow.in/129538/nptel-exam-ada?show=129545#a129545Sat, 13 May 2017 18:45:46 +0000Answered: made easy test series
http://gateoverflow.in/129388/made-easy-test-series?show=129393#a129393
O(log n) => t = c*log n<br />
<br />
For X, 12 = c*log (|X|)<br />
<br />
For Y, 20 = c*log 32<br />
<br />
So, $\frac{12}{20} = \frac{log(|X|)}{log(32)}$<br />
<br />
=> $\frac{3}{5} = \frac{log(|X|)}5$<br />
<br />
=> $log(|X|) = 3$<br />
<br />
=> |X| = 8Algorithmshttp://gateoverflow.in/129388/made-easy-test-series?show=129393#a129393Fri, 12 May 2017 11:33:01 +0000Answered: Quick sort algorithm selects (n/5)th element as the smallest element
http://gateoverflow.in/129175/quick-sort-algorithm-selects-element-the-smallest-element?show=129389#a129389
Correct answer is O(n log (base 4/5) n) so according to ans it would be O(n logn)<br />
<br />
Here T(n) = O(n) + T(n/5) + T(4n/5)<br />
<br />
T(n) = Cn+T(n/5)+T(4n/5) here<br />
<br />
we will make recurrence tree between which will be between n/5 and 4n/5<br />
<br />
and you will get n/(4n/5)^k = 1<br />
<br />
k = log (base 4/5) n <br />
<br />
so Cn* (log (base 4/5) n) = o(nlogn)Algorithmshttp://gateoverflow.in/129175/quick-sort-algorithm-selects-element-the-smallest-element?show=129389#a129389Fri, 12 May 2017 11:23:49 +0000Answered: test series
http://gateoverflow.in/129295/test-series?show=129381#a129381
Here in ur question use Master Theorem use 2(a) as a=b and p=0<br />
<br />
So a = 2,b=2,k=1,p=0<br />
<br />
Using this we get nlogn,<br />
<br />
Now as T(n)>= function so use Omega<br />
<br />
So ans is Omega(nlogn)Algorithmshttp://gateoverflow.in/129295/test-series?show=129381#a129381Fri, 12 May 2017 11:06:21 +0000Answered: Related to time complexity
http://gateoverflow.in/129203/related-to-time-complexity?show=129254#a129254
<p>let put n = 2<sup>m</sup></p>
<p>now</p>
<p>1) n = 2<sup>m</sup></p>
<p>2) (log n)<sup>100</sup></p>
<p>(log 2<sup>m</sup>)<sup>100 </sup></p>
<p>=m<sup>100 </sup> (if take base 2)</p>
<p>now u can see that 1st one is exponential time and 2nd one is pollynomial time </p>
<p>so n > (log n)<sup>100</sup></p>
<p> </p>
<p> </p>Algorithmshttp://gateoverflow.in/129203/related-to-time-complexity?show=129254#a129254Thu, 11 May 2017 08:25:20 +0000Answered: Each row and column of a matrix is sorted find the position of any given element
http://gateoverflow.in/129172/each-row-and-column-matrix-sorted-find-position-given-element?show=129182#a129182
<p><a rel="nofollow" href="http://stackoverflow.com/questions/10589975/find-number-in-sorted-matrix-rows-n-columns-in-olog-n">http://stackoverflow.com/questions/10589975/find-number-in-sorted-matrix-rows-n-columns-in-olog-n</a></p>
<p>See this. It may help You.</p>Algorithmshttp://gateoverflow.in/129172/each-row-and-column-matrix-sorted-find-position-given-element?show=129182#a129182Wed, 10 May 2017 14:23:00 +0000Answered: ISRO2017-17
http://gateoverflow.in/129119/isro2017-17?show=129170#a129170
Option b queueAlgorithmshttp://gateoverflow.in/129119/isro2017-17?show=129170#a129170Wed, 10 May 2017 12:56:20 +0000Answered: GATE2012_4
http://gateoverflow.in/36/gate2012_4?show=129067#a129067
(B) NP-complete ∩∩ P = ϕϕAlgorithmshttp://gateoverflow.in/36/gate2012_4?show=129067#a129067Tue, 09 May 2017 20:33:25 +0000Answered: MIT assignment Doubt
http://gateoverflow.in/128984/mit-assignment-doubt?show=128986#a128986
$\begin{align*} & \;\; \;\; \; F(x) = O(G(x)) \\ &\Rightarrow |F(x)| \leq {\bf c}|G(x)| \;\; \text{ for all } x \geq x_0 \text{ and } x_0,c > 0 \end{align*}$<br />
<br />
In this QS : <br />
<br />
$\begin{align*} &F(x) = n\log_2 n \\ &G(x) = n^2 \\ &\text{We can easily observe that }\;\; n\log_2 n = O(n^2) \;\; \text{ for c = 1 and }x_0 = 2 \end{align*}$Algorithmshttp://gateoverflow.in/128984/mit-assignment-doubt?show=128986#a128986Tue, 09 May 2017 08:05:08 +0000Answered: Shortest path
http://gateoverflow.in/128948/shortest-path?show=128962#a128962
a) Dijkstra's algorithm may work for some negative weight edges but not all cases which include negative edges. Dijkstra's algorithm fails for any negative weight cycle. Negative weight cycle is a cycle in which sum of all the edges is negative. But yes it will terminate for negative edge as well as for negative edge cycle. It always terminates after |E| times relaxation happens<br />
<br />
b)There exist no algorithm to find shortest path with a negative edge cycle. Bellmen Ford algorithm relaxes an edge (number of vertices -1) times. Hence, if the same edge can be relaxed again then it shows that negative edge cycle exist in the graph. In this case Bellmen Ford algorithm returns FALSE. Bellmen Ford algorithm deals with negative edge cycles by detecting them, whereas Dijkstra's algorithm fails.<br />
<br />
Refer CLRS for detailed explanationAlgorithmshttp://gateoverflow.in/128948/shortest-path?show=128962#a128962Mon, 08 May 2017 22:55:23 +0000Answered: Relation between k and k-1 edge connected graph
http://gateoverflow.in/128029/relation-between-k-and-k-1-edge-connected-graph?show=128931#a128931
<p>k edge connected graph : A graph that is connected remains connected when less than k number of edges are removed is called a k edge connected graph.
<br>
For example
<br>
<img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=12366043276973393181">
<br>
According to the definition a triangle is also a 1 edge connected graph but not 3 edge connected graph because removing 2 edges will disconnect it. So, it should be "every k connected graph is also k-1 connected graph" but the reverse is not true.
<br>
<br>
Correct me if i am wrong,anyone.
<br>
</p>Algorithmshttp://gateoverflow.in/128029/relation-between-k-and-k-1-edge-connected-graph?show=128931#a128931Mon, 08 May 2017 17:12:00 +0000Answered: Derive the best and worst case complexity of insertion sort?
http://gateoverflow.in/128680/derive-the-best-and-worst-case-complexity-of-insertion-sort?show=128875#a128875
<p>Insertion sort works just like how you arrange a pack of playing cards in your hand.
<br>
1.Start with an empty hand with a pack of cards(faced down) on a table.
<br>
2.Pick one card at a time from the table and insert it in the correct position in your hand.
<br>
3.To find the correct position of the card, compare it with each card in the hand from right to left.
<br>
(Notice that cards in the hand are already sorted)</p>
<p>Algorithmically :
<br>
<strong>Insertion Sort(A)</strong></p>
<ol>
<li> <strong>for i = 2 to length(A)</strong> <em>// Start with the 2nd element because the first element is trivially sorted</em></li>
<li> <strong> x=A[i]</strong> // <em>x is the element you want to insert in right place into the already sorted set of elements</em></li>
<li> <strong> j=i-1 </strong> // <em>Last index of the already sorted elements because thats where you want to start comparing x</em></li>
<li> <strong>while j>0 and A[j]>x</strong> // <em>Whenever there is an element greater than x</em></li>
<li> <strong> A[j+1]=A[j]</strong> //<em> shift it to the right</em></li>
<li> <strong> j = j-1</strong></li>
<li> <strong> end while</strong></li>
<li> <strong> A[j+1]=x</strong> // <em>The correct position to insert x</em></li>
<li><strong> end for</strong></li>
</ol>
<p>Analyzing the time complexity :</p>
<p>
<br>
Best case :
<br>
1. Outer for loop runs for (n-1) times
<br>
4. Inner while loop exits the loop in the very first comparison // Eg - Sorted set : 2 4 5 7, Element to insert : 9
<br>
1+1+1+...+(n-1) times => <strong> Ω(n)</strong></p>
<p>
<br>
Average case :
<br>
1. Outer for loop runs for (n-1) times
<br>
4. On average the inner while loop runs for (n-2)/2 times // Eg - Sorted set : 2 4 <em>10 12</em>, Element to insert : 9
<br>
1/2+2/2+3/2+4/2+....(n-1)/2 = (1+2+3+...+(n-1))/2
<br>
= ((n-1)*n)/4 => <strong>Θ(n<sup>2</sup>)</strong></p>
<p>Worst case :
<br>
1. Outer for loop runs for (n-1) times
<br>
4. In worst case the inner while loop runs for (n-2) times // Eg - Sorted set : <em>10 11 12 13</em>, Element to insert : 9
<br>
1+2+3+...+(n-1) = ((n-1)*n)/2 => <strong>O(n<sup>2</sup>)
<br>
<br>
<br>
Also, have a look at the formal model/framework for analyzing algorithms :
<br>
1. Instructions are executed sequentially
<br>
2. Instructions are simple, like addition,multiplication, comparison, assignment etc are assumed to take one time unit
<br>
3. Infinite memory</strong>
<br>
</p>Algorithmshttp://gateoverflow.in/128680/derive-the-best-and-worst-case-complexity-of-insertion-sort?show=128875#a128875Mon, 08 May 2017 12:37:33 +0000Answered: ISRO2017-15
http://gateoverflow.in/128545/isro2017-15?show=128870#a128870
Selection Sort is best sorting algorithm in terms of minimum no. of swap = O(n)Algorithmshttp://gateoverflow.in/128545/isro2017-15?show=128870#a128870Mon, 08 May 2017 12:16:59 +0000Answered: ISRO2017-80
http://gateoverflow.in/128781/isro2017-80?show=128816#a128816
Option c is the answerAlgorithmshttp://gateoverflow.in/128781/isro2017-80?show=128816#a128816Mon, 08 May 2017 00:10:11 +0000Answered: ISRO2017-49
http://gateoverflow.in/128694/isro2017-49?show=128800#a128800
ans 14 but not in optionAlgorithmshttp://gateoverflow.in/128694/isro2017-49?show=128800#a128800Sun, 07 May 2017 23:21:01 +0000Answered: Solve the Recurrence using Master Total Confusion as fraction part is there
http://gateoverflow.in/128482/solve-recurrence-using-master-total-confusion-fraction-there?show=128651#a128651
<p>Pls correct me if i am wrong</p>
<p><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=1898589618081136368"></p>Algorithmshttp://gateoverflow.in/128482/solve-recurrence-using-master-total-confusion-fraction-there?show=128651#a128651Sun, 07 May 2017 19:25:47 +0000Answered: Solve using Recursion Tree method when both parts are unequal
http://gateoverflow.in/128484/solve-using-recursion-tree-method-when-both-parts-are-unequal?show=128595#a128595
This is of the form:-T(n)=T(an)+T((1-a)n)+bn where a=1/3 so 1-a=2/3.<br />
<br />
The solution of this type of relation is: t(n)=O(nlogn).Algorithmshttp://gateoverflow.in/128484/solve-using-recursion-tree-method-when-both-parts-are-unequal?show=128595#a128595Sun, 07 May 2017 17:30:28 +0000Answered: ISRO2017-76
http://gateoverflow.in/128494/isro2017-76?show=128584#a128584
Option DAlgorithmshttp://gateoverflow.in/128494/isro2017-76?show=128584#a128584Sun, 07 May 2017 17:15:18 +0000Answered: GATE1994-1.7, ISRO2017-14
http://gateoverflow.in/2444/gate1994-1-7-isro2017-14?show=128578#a128578
Option BAlgorithmshttp://gateoverflow.in/2444/gate1994-1-7-isro2017-14?show=128578#a128578Sun, 07 May 2017 17:11:40 +0000Solve the Recurrence using Iteration Method
http://gateoverflow.in/128456/solve-the-recurrence-using-iteration-method
Solve the Recurrence using Iteration Method<br />
<br />
T(n)=3$(\frac{n}{4})$ + nAlgorithmshttp://gateoverflow.in/128456/solve-the-recurrence-using-iteration-methodSun, 07 May 2017 11:56:47 +0000Doubt
http://gateoverflow.in/128444/doubt
How to get complexity of recurrence:<br />
<br />
$T(n) = \sqrt{n} .T(\sqrt{n}) + n$Algorithmshttp://gateoverflow.in/128444/doubtSun, 07 May 2017 09:46:11 +0000Doubt regarding Activity selection problem
http://gateoverflow.in/128354/doubt-regarding-activity-selection-problem
Given n activities with their start and finish times.Select d mad no of activities dat can be performed by a single person assuming tat a person can only work on a single activity at a timeAlgorithmshttp://gateoverflow.in/128354/doubt-regarding-activity-selection-problemSat, 06 May 2017 12:52:07 +0000Cormen 3rd edition
http://gateoverflow.in/128300/cormen-3rd-edition
Which is asymptotically larger: lg(lg* n) or lg* (lg n)?Algorithmshttp://gateoverflow.in/128300/cormen-3rd-editionFri, 05 May 2017 23:31:02 +0000#Algorithms
http://gateoverflow.in/128286/%23algorithms
Can somebody help me out to figure out an algorithm that would work in O(nlogn) for the following problem?<br />
<br />
Given a SORTED array of n elements. Find three numbers from the array that will add up to a given number k.<br />
<br />
My approach:<br />
Use two pointers that point to first and last elements(say L and H). Add these two elements and subtract it from required value k and store it in a variable, say 'z'. Now binary search for z among the elements between the two pointers. If z is found we have the required 3 numbers. If z is not found, we have to either increment L or decrement H and repeat the process.<br />
<br />
So essentially we reduce the size of list by one and perform at most logn comparisons in each iteration, hence O(nlogn)<br />
<br />
I can't figure out when to increment L or when to decrement H, in case z is not found. Any ideas?<br />
<br />
Thank youAlgorithmshttp://gateoverflow.in/128286/%23algorithmsFri, 05 May 2017 21:26:03 +0000State and explain master theorem
http://gateoverflow.in/128269/state-and-explain-master-theorem
<p><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=11917086768086723743"></p>Algorithmshttp://gateoverflow.in/128269/state-and-explain-master-theoremFri, 05 May 2017 18:56:20 +0000Prove or disprove the following
http://gateoverflow.in/128266/prove-or-disprove-the-following
<p><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=2826952950339505612"></p>Algorithmshttp://gateoverflow.in/128266/prove-or-disprove-the-followingFri, 05 May 2017 18:46:05 +0000#GARPH_ALGORITHM
http://gateoverflow.in/128200/%23garph_algorithm
I want to know in which condition we should apply BFS and DFS for GRAPH Search ? And why?Algorithmshttp://gateoverflow.in/128200/%23garph_algorithmFri, 05 May 2017 12:07:45 +0000Placing rooks in nXn chess board
http://gateoverflow.in/128051/placing-rooks-in-nxn-chess-board
<p>Write a recursive backtracking solution for placing $3$ rooks in $6^*6$ chess board.</p>
<ol>
<li>Naive backtracking.</li>
<li>Try using bitmask to speed it up.</li>
</ol>
<p> </p>Algorithmshttp://gateoverflow.in/128051/placing-rooks-in-nxn-chess-boardThu, 04 May 2017 09:32:29 +0000How many Spanning Trees are possible from the graph?
http://gateoverflow.in/127997/how-many-spanning-trees-are-possible-from-the-graph
<p>How many Spanning Trees are possible from the graph given below?</p>
<p>(a) 24</p>
<p>(b) 34</p>
<p>(c) 44</p>
<p>(d) 54</p>
<p style="text-align:center"><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=6231739173630245746"></p>
<p> </p>Algorithmshttp://gateoverflow.in/127997/how-many-spanning-trees-are-possible-from-the-graphWed, 03 May 2017 20:22:26 +0000Please explain already answered Question
http://gateoverflow.in/127855/please-explain-already-answered-question
<p>Link to the question - <a rel="nofollow" href="http://gateoverflow.in/20611/tifr2011-b-30">http://gateoverflow.in/20611/tifr2011-b-30</a></p>
<p>Someone please simplify that question and explain.</p>Algorithmshttp://gateoverflow.in/127855/please-explain-already-answered-questionTue, 02 May 2017 19:45:09 +0000Hamiltonian circuit
http://gateoverflow.in/127487/hamiltonian-circuit
Hamiltonian circuit can be most perfectly related with:<br />
<br />
A. Greedy approach <br />
<br />
B. Dynamic programming <br />
<br />
C. Backtracking<br />
<br />
D. Branch and boundAlgorithmshttp://gateoverflow.in/127487/hamiltonian-circuitSun, 30 Apr 2017 13:57:21 +0000Time complexity
http://gateoverflow.in/127435/time-complexity
<p><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=9409269099162459170"></p>Algorithmshttp://gateoverflow.in/127435/time-complexitySun, 30 Apr 2017 06:55:17 +0000GeeksforGeeks Algorithms
http://gateoverflow.in/127340/geeksforgeeks-algorithms
<p><a rel="nofollow" href="http://quiz.geeksforgeeks.org/merge-sort/">http://quiz.geeksforgeeks.org/merge-sort/</a></p>
<p>in mergesort(arr,l,r) method m=l+(r-l)/2</p>
<p><code>// Same as (l+r)/2, but avoids overflow for</code></p>
<p><code> </code><code>// large l and h</code></p>
<p>what does this mean ,explain with example.</p>
<p> </p>Algorithmshttp://gateoverflow.in/127340/geeksforgeeks-algorithmsSat, 29 Apr 2017 13:52:42 +0000Where to study these topics listed in this post
http://gateoverflow.in/127337/where-to-study-these-topics-listed-in-this-post
<p>Hello fellow GO members. What's the proper order and from where to start and reading about -</p>
<p><strong>Search operations like Linear Search and Binary Search etc and Operations on Array!</strong></p>
<p>Please someone tell me what subjects these topics from and what books or video lectures should I follow?</p>
<p> </p>
<p>Thanks!</p>Algorithmshttp://gateoverflow.in/127337/where-to-study-these-topics-listed-in-this-postSat, 29 Apr 2017 13:23:46 +0000Graph Explanation-Somebody please kindly explain this graph.
http://gateoverflow.in/127263/graph-explanation-somebody-please-kindly-explain-this-graph
<p><img alt="" src="http://gateoverflow.in/?qa=blob&qa_blobid=14252718235649527488"></p>Algorithmshttp://gateoverflow.in/127263/graph-explanation-somebody-please-kindly-explain-this-graphFri, 28 Apr 2017 22:10:43 +0000Cormen
http://gateoverflow.in/127259/cormen
Given an adjacency-list representation of a directed graph, how long does it take to compute the out degree of every vertex? How long does it take to compute in-degrees?Algorithmshttp://gateoverflow.in/127259/cormenFri, 28 Apr 2017 21:01:50 +0000Book corman
http://gateoverflow.in/127183/book-corman
How many elements of the in- put sequence need to be checked on the average, assuming that the element being searched for is equally likely to be any element in the array? How about in the worst case? What are the average-case and worst-case running times of linear search in O notation? Justify your answers.Algorithmshttp://gateoverflow.in/127183/book-cormanFri, 28 Apr 2017 00:50:57 +0000