THE GATEBOOK Q&A - Recent questions and answers
http://thegatebook.in/qa/qa
Powered by Question2AnswerAnswered: Algorithms-Test 1- Different techniques- 18
http://thegatebook.in/qa/2588/algorithms-test-1-different-techniques-18?show=2824#a2824
C is the answer.<br />
<br />
A: a graph can have more than one shortest path between two vertices. this is true when different paths leads to same weight.<br />
<br />
a-----------------c <br />
<br />
| /<br />
<br />
| /<br />
<br />
b<br />
<br />
consider this graph abc. if ab=3,ac=2 and cb=5, we have multiple shortest paths between b and c.<br />
<br />
<br />
<br />
B. again true. in below graph, if ab=3,ad=4,bc=5,cd=2 , all edge weights are distinct but there exists more than one shortest path between b and d<br />
<br />
b<br />
<br />
/ \<br />
<br />
a c<br />
<br />
\ /<br />
<br />
d<br />
<br />
<br />
<br />
C : false. the spanning tree won't change. only the weight of the mst will change.Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2588/algorithms-test-1-different-techniques-18?show=2824#a2824Wed, 10 Jan 2018 13:16:37 +0000Answered: DS-Topic 2-Stacks,Queues,LLs-Question 10
http://thegatebook.in/qa/2517/ds-topic-2-stacks-queues-lls-question-10?show=2817#a2817
I didn't get it. somebody, please explain this.Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2517/ds-topic-2-stacks-queues-lls-question-10?show=2817#a2817Thu, 09 Nov 2017 11:48:42 +0000Answers to 17 Questions in Discrete Maths Test 3 (Graph Theory) are not given.
http://thegatebook.in/qa/2815/answers-questions-discrete-maths-test-graph-theory-not-given
Discrete Mathshttp://thegatebook.in/qa/2815/answers-questions-discrete-maths-test-graph-theory-not-givenMon, 06 Nov 2017 17:33:28 +0000Answered: TOC-Test3-Q1
http://thegatebook.in/qa/2684/toc-test3-q1?show=2814#a2814
L is a recursive language and hence is decidable as Total Turing Machine exists for this language and for its finite subset, we can construct a DFA. Hence finite subset of L is Regular.TOChttp://thegatebook.in/qa/2684/toc-test3-q1?show=2814#a2814Sun, 05 Nov 2017 09:46:47 +0000Answered: TOC-Test1-Q16
http://thegatebook.in/qa/2659/toc-test1-q16?show=2811#a2811
Let there is a DFA "P" which has exactly two a's. Such a DFA "P" will have 3 states.<br />
<br />
Let there is a DFA "Q" which has at least two b's. Such a DFA "Q" will have 3 states.<br />
<br />
But we want the DFA "Z" which has exactly two a's and at least two b's. We can get this DFA by taking the cross product of "P" and "Q" i.e. Z=P X Q. As there are 3 states in "P" and 3 states in "Q". After cross product, resultant DFA "Z" will have 9 states and 1 dead state will also be created. Hence total states will be 10.TOChttp://thegatebook.in/qa/2659/toc-test1-q16?show=2811#a2811Fri, 03 Nov 2017 17:04:58 +0000Answered: TOC-Test1-Q14
http://thegatebook.in/qa/2657/toc-test1-q14?show=2809#a2809
Here, A and B should be made the final states or accepting states if this automaton has to accept the language of strings with zero or even number of 1's. Hence, the answer is 2.TOChttp://thegatebook.in/qa/2657/toc-test1-q14?show=2809#a2809Fri, 03 Nov 2017 12:47:36 +0000Answered: TOC-Test1-Q19
http://thegatebook.in/qa/2662/toc-test1-q19?show=2808#a2808
None of the option is right. I think its 0*10*0TOChttp://thegatebook.in/qa/2662/toc-test1-q19?show=2808#a2808Mon, 30 Oct 2017 11:58:11 +0000Answered: Discrete-Test 5-Graph theory-Q12
http://thegatebook.in/qa/2328/discrete-test-5-graph-theory-q12?show=2807#a2807
What is the answer??Discrete Mathshttp://thegatebook.in/qa/2328/discrete-test-5-graph-theory-q12?show=2807#a2807Sat, 28 Oct 2017 16:58:23 +0000Answered: TOC-Test3-Q15
http://thegatebook.in/qa/2698/toc-test3-q15?show=2806#a2806
Someone please explain thisTOChttp://thegatebook.in/qa/2698/toc-test3-q15?show=2806#a2806Sat, 28 Oct 2017 15:42:35 +0000Answered: DS-Topic 3-Trees,graphs-Question 17
http://thegatebook.in/qa/2545/ds-topic-3-trees-graphs-question-17?show=2805#a2805
For searching 3 , we will have the comparisons at 55->31->14->3 . similarly for 98.<br />
<br />
therefore, largest number of comparisons is 4.Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2545/ds-topic-3-trees-graphs-question-17?show=2805#a2805Mon, 23 Oct 2017 16:40:01 +0000Answered: DS-Topic 3-Trees,graphs-Question 6
http://thegatebook.in/qa/2534/ds-topic-3-trees-graphs-question-6?show=2804#a2804
A graph is said to be regular of degree r if all local degrees are the same number r .Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2534/ds-topic-3-trees-graphs-question-6?show=2804#a2804Mon, 23 Oct 2017 16:36:36 +0000Answered: DS-Topic 3-Trees,graphs-Question 7
http://thegatebook.in/qa/2535/ds-topic-3-trees-graphs-question-7?show=2803#a2803
it is the fifth catalan number = (2n,n)/(n+1)<br />
<br />
= (10,5)/6<br />
<br />
=42Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2535/ds-topic-3-trees-graphs-question-7?show=2803#a2803Mon, 23 Oct 2017 16:32:20 +0000Answered: DS-Topic 2-Stacks,Queues,LLs-Question 19
http://thegatebook.in/qa/2526/ds-topic-2-stacks-queues-lls-question-19?show=2802#a2802
we just need to check null for q, isn't it? anyway if P is null , then q will be definitely be null.Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2526/ds-topic-2-stacks-queues-lls-question-19?show=2802#a2802Sun, 22 Oct 2017 09:34:44 +0000Answered: DS-Topic1- Programming and arrays- Question 7
http://thegatebook.in/qa/2494/ds-topic1-programming-and-arrays-question-7?show=2801#a2801
option A is correct we can initialize values like that.<br />
<br />
option b has a typo it should be x=y instead of X=y, the function it performs it just copies the values of variable y to x in the same format of the common struct that they shared.<br />
<br />
option c is correct. Both operations are possible.<br />
<br />
so Only option D remains incorrect which is our answer,Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2494/ds-topic1-programming-and-arrays-question-7?show=2801#a2801Sun, 22 Oct 2017 08:09:17 +0000Answered: DS-Topic1- Programming and arrays- Question 6
http://thegatebook.in/qa/2493/ds-topic1-programming-and-arrays-question-6?show=2800#a2800
<p>While reading option D we Read it as " F is a <strong>function of Array</strong> which returns a pointer to integer".<br>
And there nothing like Function of an array, so option D is wrong. Option B is a typo.</p>Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2493/ds-topic1-programming-and-arrays-question-6?show=2800#a2800Sun, 22 Oct 2017 07:55:25 +0000Answered: DS-Topic 2-Stacks,Queues,LLs-Question 8
http://thegatebook.in/qa/2515/ds-topic-2-stacks-queues-lls-question-8?show=2799#a2799
<p>I'm getting answer as 4.</p>
<p>Initially, </p>
<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
<tbody>
<tr>
<td> </td>
<td> </td>
<td>6</td>
<td>5</td>
<td>4</td>
<td>3</td>
<td>2</td>
<td>1</td>
</tr>
</tbody>
</table>
<p> </p>
<p> </p>
<p>and in second for loop, elements 1,3 and 5 will be dequeued and 2,4 and 6 will be dequeued and enqueued. which will give, </p>
<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
<tbody>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>6</td>
<td>4</td>
<td>2</td>
</tr>
</tbody>
</table>
<p>element at index 1 is 4 ?</p>
<p>Kindly verify this answer.</p>Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2515/ds-topic-2-stacks-queues-lls-question-8?show=2799#a2799Sun, 22 Oct 2017 04:00:54 +0000Answered: DS-Topic 2-Stacks,Queues,LLs-Question 6
http://thegatebook.in/qa/2513/ds-topic-2-stacks-queues-lls-question-6?show=2798#a2798
rear pointer is also there or do we have to perform operations with only one pointer??Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2513/ds-topic-2-stacks-queues-lls-question-6?show=2798#a2798Sun, 22 Oct 2017 03:51:12 +0000Answered: Algorithms-Test 3 - Graphs and Hashing - 13
http://thegatebook.in/qa/2603/algorithms-test-3-graphs-and-hashing-13?show=2795#a2795
Is there any algorithm or systematic procedure or have to solve considering all probabilities and count??Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2603/algorithms-test-3-graphs-and-hashing-13?show=2795#a2795Sat, 21 Oct 2017 08:20:24 +0000Answered: Algorithms-Test 3 - Graphs and Hashing - 12
http://thegatebook.in/qa/2602/algorithms-test-3-graphs-and-hashing-12?show=2794#a2794
Some one tell how to solve thisData Structures Algorithms and C Programminghttp://thegatebook.in/qa/2602/algorithms-test-3-graphs-and-hashing-12?show=2794#a2794Sat, 21 Oct 2017 08:13:36 +0000Answered: Algorithms-Test 3 - Graphs and Hashing - 11
http://thegatebook.in/qa/2601/algorithms-test-3-graphs-and-hashing-11?show=2793#a2793
Some one explain it.What is additional space means here?/Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2601/algorithms-test-3-graphs-and-hashing-11?show=2793#a2793Sat, 21 Oct 2017 08:09:01 +0000Answered: Algorithms-Test 1- Different techniques- 10
http://thegatebook.in/qa/2580/algorithms-test-1-different-techniques-10?show=2791#a2791
Answer is B.I think question is to be updated or answer.It is a duplicate questionData Structures Algorithms and C Programminghttp://thegatebook.in/qa/2580/algorithms-test-1-different-techniques-10?show=2791#a2791Sat, 21 Oct 2017 06:31:55 +0000Answered: Algorithms-Test 3 - Graphs and Hashing - 19
http://thegatebook.in/qa/2609/algorithms-test-3-graphs-and-hashing-19?show=2789#a2789
A is also rightData Structures Algorithms and C Programminghttp://thegatebook.in/qa/2609/algorithms-test-3-graphs-and-hashing-19?show=2789#a2789Sat, 21 Oct 2017 06:00:36 +0000Answered: Algorithms-Test 1-Complexity analysis - 5
http://thegatebook.in/qa/2555/algorithms-test-1-complexity-analysis-5?show=2788#a2788
Why Can't it be Answer D Sir?? Can you explainData Structures Algorithms and C Programminghttp://thegatebook.in/qa/2555/algorithms-test-1-complexity-analysis-5?show=2788#a2788Sat, 21 Oct 2017 04:59:29 +0000Please open DBMS test sir
http://thegatebook.in/qa/2750/please-open-dbms-test-sir
I have completed dbms lectures so I want to make a request that please open dbms test days schedule has been gone .DBMShttp://thegatebook.in/qa/2750/please-open-dbms-test-sirSat, 14 Oct 2017 19:09:06 +0000Answered: TOC-Test2-Q19
http://thegatebook.in/qa/2682/toc-test2-q19?show=2748#a2748
<p><strong>Step 1</strong>: Remove epsilon transitions <br>
Nullable variables = {A, B}</p>
<p>Modified grammar after removal of null productions: <br>
S->ASA |aB |a | AS | SA | S <br>
A -> B | S <br>
B-> b <br>
<br>
<strong>Step 2</strong>: Remove Unit Productions <br>
S->ASA |aB |a | AS | SA | <strong>S</strong> <br>
A -> <strong>B</strong> | <strong>S</strong> <br>
B-> b</p>
<p>Modified grammar after the removal of the unit productions: <br>
S->ASA |aB |a | AS | SA <br>
A -> b | ASA |aB |a | AS | SA <br>
B-> b</p>
<p><strong>Step 3:</strong> from CFG to CNF</p>
<p>S->AA" |A'B |a | AS | SA <br>
A -> b | AA" |A'B |a | AS | SA <br>
B-> b<br>
A' ->a<br>
A"->SA</p>
<p><strong>14 productions in the corresponding CNF.</strong></p>
<p> </p>TOChttp://thegatebook.in/qa/2682/toc-test2-q19?show=2748#a2748Fri, 13 Oct 2017 18:35:33 +0000Answered: TOC-Test2-Q18
http://thegatebook.in/qa/2681/toc-test2-q18?show=2747#a2747
<p><strong>Step 1</strong>: Remove epsilon transitions <br>
Nullable variables = {A, B}</p>
<p>Modified grammar after removal of null productions: <br>
S->ASA |aB |a | AS | SA | S <br>
A -> B | S <br>
B-> b <br>
<br>
<strong>Step 2</strong>: Remove Unit Productions <br>
S->ASA |aB |a | AS | SA | <strong>S</strong> <br>
A -> <strong>B</strong> | <strong>S</strong> <br>
B-> b</p>
<p>Modified grammar after the removal of the unit productions: <br>
S->ASA |aB |a | AS | SA <br>
A -> b | ASA |aB |a | AS | SA <br>
B-> b</p>TOChttp://thegatebook.in/qa/2681/toc-test2-q18?show=2747#a2747Fri, 13 Oct 2017 18:33:58 +0000Answered: TOC-Test2-Q16
http://thegatebook.in/qa/2679/toc-test2-q16?show=2746#a2746
<p>(A) is the correct option!</p>
<p><img alt="" src="http://thegatebook.in/qa/?qa=blob&qa_blobid=12321597559085571821"></p>TOChttp://thegatebook.in/qa/2679/toc-test2-q16?show=2746#a2746Fri, 13 Oct 2017 17:07:53 +0000Answered: TOC-Test2-Q17
http://thegatebook.in/qa/2680/toc-test2-q17?show=2745#a2745
<p>following is the definition of Pumping Lemma:</p>
<p><img alt="" src="http://thegatebook.in/qa/?qa=blob&qa_blobid=3983727980391260373"></p>
<p>Hence (B) is correct option!</p>TOChttp://thegatebook.in/qa/2680/toc-test2-q17?show=2745#a2745Fri, 13 Oct 2017 14:09:30 +0000Answered: TOC-Test2-Q1
http://thegatebook.in/qa/2664/toc-test2-q1?show=2744#a2744
DCFL is closed under UNION with regular languages, hence the answer of this question is (A) <br />
<br />
because first language is DCFL and second finite language is Regular.TOChttp://thegatebook.in/qa/2664/toc-test2-q1?show=2744#a2744Fri, 13 Oct 2017 14:01:39 +0000Answered: TOC-Test2-Q20
http://thegatebook.in/qa/2683/toc-test2-q20?show=2743#a2743
4 is correct answer!<br />
<br />
All the given four statements are true!TOChttp://thegatebook.in/qa/2683/toc-test2-q20?show=2743#a2743Fri, 13 Oct 2017 11:53:52 +0000Answered: TOC-Test3-Q18
http://thegatebook.in/qa/2701/toc-test3-q18?show=2742#a2742
Sir i think answer is option A.TOChttp://thegatebook.in/qa/2701/toc-test3-q18?show=2742#a2742Thu, 12 Oct 2017 07:49:24 +0000Answered: Graph theory - Test 5 - Q16
http://thegatebook.in/qa/2628/graph-theory-test-5-q16?show=2741#a2741
according to me answer will be 21Discrete Mathshttp://thegatebook.in/qa/2628/graph-theory-test-5-q16?show=2741#a2741Wed, 11 Oct 2017 15:09:18 +0000Answered: TOC-Test2-Q15
http://thegatebook.in/qa/2678/toc-test2-q15?show=2739#a2739
It is given that answer is option D but in in this grammer we can't generate string (a lembda) as every string is ends with lembda.TOChttp://thegatebook.in/qa/2678/toc-test2-q15?show=2739#a2739Wed, 11 Oct 2017 14:33:23 +0000Answered: TOC-Test2-Q9
http://thegatebook.in/qa/2672/toc-test2-q9?show=2738#a2738
I think we can't generate string aab as we can't get rid of variable A.TOChttp://thegatebook.in/qa/2672/toc-test2-q9?show=2738#a2738Wed, 11 Oct 2017 14:29:41 +0000Answered: TOC-Test3-Q6
http://thegatebook.in/qa/2689/toc-test3-q6?show=2737#a2737
L is DecidableTOChttp://thegatebook.in/qa/2689/toc-test3-q6?show=2737#a2737Wed, 11 Oct 2017 14:01:38 +0000Answered: Q8 Talent Test
http://thegatebook.in/qa/1622/q8-talent-test?show=2735#a2735
answer is 0% <br />
<br />
say number is 100<br />
<br />
it is divided by 2/3,then it becomes 100/(2/3)=100*3/2=150Aptitudehttp://thegatebook.in/qa/1622/q8-talent-test?show=2735#a2735Wed, 11 Oct 2017 05:49:56 +0000Answered: Q11 Talent test
http://thegatebook.in/qa/1625/q11-talent-test?show=2734#a2734
ans is A i.e. 5 <br />
<br />
number of valid push pop operation is given by catalog number 2n C n/(n+1)<br />
<br />
n=3<br />
<br />
6C3/4=5 where C is for combination symbolAptitudehttp://thegatebook.in/qa/1625/q11-talent-test?show=2734#a2734Wed, 11 Oct 2017 05:45:40 +0000Answered: TOC-Test3-Q20
http://thegatebook.in/qa/2703/toc-test3-q20?show=2733#a2733
regular language -type3 accepted by fsm<br />
<br />
context free language=type2 accepted by pda<br />
<br />
context sensitive language=type 1 accepted by machine like turing machine but tape length is finite<br />
<br />
recursive enumerable=type0 accepted by turing machineTOChttp://thegatebook.in/qa/2703/toc-test3-q20?show=2733#a2733Wed, 11 Oct 2017 05:40:53 +0000sir DBMS paper is not present ,Why?
http://thegatebook.in/qa/2732/sir-dbms-paper-is-not-present-why
DBMShttp://thegatebook.in/qa/2732/sir-dbms-paper-is-not-present-whyWed, 11 Oct 2017 05:35:38 +0000Answered: C programming
http://thegatebook.in/qa/2459/c-programming?show=2731#a2731
it is showing compile time error in ++++b .Data Structures Algorithms and C Programminghttp://thegatebook.in/qa/2459/c-programming?show=2731#a2731Tue, 10 Oct 2017 12:17:54 +0000Answered: Propositional logic
http://thegatebook.in/qa/2478/propositional-logic?show=2730#a2730
according to me s2 is right <br />
<br />
try to understand it <br />
<br />
if (for every x,there is some y (if x and y are best friend then for every z y and z are not same) then x and z are not best friendDiscrete Mathshttp://thegatebook.in/qa/2478/propositional-logic?show=2730#a2730Tue, 10 Oct 2017 12:13:32 +0000why DBMS test is not available ,as it is mentioned to be published on 9 sept
http://thegatebook.in/qa/2729/why-dbms-test-not-available-it-mentioned-be-published-on-sept
DBMShttp://thegatebook.in/qa/2729/why-dbms-test-not-available-it-mentioned-be-published-on-septTue, 10 Oct 2017 12:06:47 +0000Answered: TOC-Test1-Q3
http://thegatebook.in/qa/2646/toc-test1-q3?show=2728#a2728
<p>5 is correct answer!</p>
<p>0-equivalent states<br>
{q0, q1,q3,q4,q5,q6} {q2,q7}<br>
<br>
1-equivalent states<br>
{q0,q3,q4,q5} {q1,q6} {q2,q7}<br>
<br>
2-equivalent states<br>
{q0,q4,q5} {q3} {q1,q6} {q2,q7}</p>
<p>3-equivalent states<br>
{q0,q4,q5} {q3} {q1} {q6} {q2q7}</p>
<p><strong>Hence, minimized DFA will have 5 states.</strong></p>
<p> </p>TOChttp://thegatebook.in/qa/2646/toc-test1-q3?show=2728#a2728Tue, 10 Oct 2017 08:33:32 +0000Answered: TOC-Test1-Q4
http://thegatebook.in/qa/2647/toc-test1-q4?show=2727#a2727
(A) is correct option, this grammar generates the language which accpets all the string which ends with 'a'.TOChttp://thegatebook.in/qa/2647/toc-test1-q4?show=2727#a2727Tue, 10 Oct 2017 03:35:38 +0000Answered: TOC-Test1-Q1
http://thegatebook.in/qa/2644/toc-test1-q1?show=2726#a2726
(C) is correct option<br />
<br />
becaue take any string, and it can be generated by both the pairs.<br />
<br />
II is not correct because the string 'rs' can be generated by second pair but not by first pair.TOChttp://thegatebook.in/qa/2644/toc-test1-q1?show=2726#a2726Tue, 10 Oct 2017 03:15:15 +0000Answered: TOC-Test1-Q20
http://thegatebook.in/qa/2663/toc-test1-q20?show=2724#a2724
L3 = Intersection of L1 and L2<br />
<br />
L3 = {ab}<br />
<br />
There are 3 prefixes of ab are, epsilon, a, and ab.<br />
<br />
hence 3 is correct option.TOChttp://thegatebook.in/qa/2663/toc-test1-q20?show=2724#a2724Mon, 09 Oct 2017 17:49:21 +0000Answered: TOC-Test1-Q17
http://thegatebook.in/qa/2660/toc-test1-q17?show=2723#a2723
When we calculate reversal of a DFA, we chage the direction of transitions and interchnage final and initial states.<br />
<br />
Reversal of a DFA may result into an NFA.<br />
<br />
(b) is correct option.TOChttp://thegatebook.in/qa/2660/toc-test1-q17?show=2723#a2723Mon, 09 Oct 2017 17:46:39 +0000Answered: TOC-Test1-Q12
http://thegatebook.in/qa/2655/toc-test1-q12?show=2722#a2722
(D) is not correct statement <br />
<br />
As left hand side language doesn't contain epsilon, while Right hand side language contains epsilon.TOChttp://thegatebook.in/qa/2655/toc-test1-q12?show=2722#a2722Mon, 09 Oct 2017 17:41:24 +0000Answered: TOC-Test1-Q10
http://thegatebook.in/qa/2653/toc-test1-q10?show=2721#a2721
All statements are false.TOChttp://thegatebook.in/qa/2653/toc-test1-q10?show=2721#a2721Mon, 09 Oct 2017 17:39:49 +0000Answered: TOC-Test1-Q9
http://thegatebook.in/qa/2652/toc-test1-q9?show=2720#a2720
(D) is false statement.<br />
<br />
As for the regular language a*b* a DFA with single state is not possible, which proves that DFA with single state has less power.TOChttp://thegatebook.in/qa/2652/toc-test1-q9?show=2720#a2720Mon, 09 Oct 2017 17:39:03 +0000