1
GATE CSE 2013
MCQ (Single Correct Answer)
+2
-0.6
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $$A.$$ The characters to be replaced are supplied in array $$oldc,$$ while their respective replacement characters are supplied in array $$newc.$$ Array $$A$$ has a fixed length of five characters, while arrays $$oldc$$ and $$newc$$ contain three characters each. However, the procedure is flawed. void find_and_replace (char $$^ * A,$$ char $$^ * oldc,$$, char $$^ * newc$$)
$$\left\{ \, \right.$$ for (int $$i=0; i<5; i++$$)
for (int $$j=0; j<3; j++$$)
if ( $$A$$ [ $$i$$ ] $$==oldc$$ [ $$j$$ ] $$A$$ [ $$i$$ ]
$$=newc$$ [ $$j$$ ]; $$\left. \, \right\}$$

The procedure is tested with the following four test cases;
$$\eqalign{ & \left( 1 \right)\,\,\,oldc = ''abc'',\,\,newc\, = \,''dab'' \cr & \left( 2 \right)\,\,\,oldc\, = \,''cdc'',\,\,newc\, = \,''bed'' \cr & \left( 3 \right)\,\,\,oldc\, = \,''bca'',\,newc\, = \,''cda'' \cr & \left( 4 \right)\,\,\,oldc\, = \,''abc'',\,newc\, = \,''bac'' \cr} $$

The tester now tests the program on all input strings of length five consisting of characters $$'a', 'b', 'c', 'd'$$ and $$'c'$$ with duplicates allowed. If the tester carries out this testing with four test cases given above, how many test cases will be able to capture the flaw?

A
Only one
B
Only two
C
Only three
D
All four
2
GATE CSE 2013
MCQ (Single Correct Answer)
+1
-0.3
Consider the languages $${L_1} = \phi $$ and $${L_2} = \left\{ a \right\}.$$ Which one of the following represents $${L_1}\,L_2^ * UL_1^ * ?$$
A
$$\left\{ \varepsilon \right\}$$
B
$$\phi $$
C
$${a^ * }$$
D
$$\left\{ {\varepsilon ,a} \right\}$$
3
GATE CSE 2013
MCQ (Single Correct Answer)
+2
-0.6
Consider the following languages
$${L_1} = \left\{ {{0^p}{1^q}{0^r}\left| {p,q,r \ge 0} \right.} \right\}$$
$${L_2} = \left\{ {{0^p}{1^q}{0^r}\left| {p,q,r \ge 0,p \ne r} \right.} \right\}$$

Which one of the following statements is FALSE?

A
$${L_2}$$ is context-free
B
$${L_1} \cap {L_2}$$ is context-free
C
Complement of $${L_2}$$ is recursive
D
Complement of $${L_1}$$ is context-free but not regular
4
GATE CSE 2013
MCQ (Single Correct Answer)
+2
-0.6
Consider the $$DFA$$ $$A$$ given below. GATE CSE 2013 Theory of Computation - Push Down Automata and Context Free Language Question 20 English

Which of the following are FALSE?
$$1.$$ Complement of $$L(A)$$ is context - free.
$$2.$$ $$L(A)$$ $$ = \left( {{{11}^ * }0 + 0} \right)\left( {0 + 1} \right){}^ * {0^ * }\left. {{1^ * }} \right)$$
$$3.$$ For the language accepted by $$A, A$$ is the minimal $$DFA.$$
$$4.$$ $$A$$ accepts all strings over $$\left\{ {0,1} \right\}$$ of length at least $$2.$$

A
$$1$$ and $$3$$ only
B
$$2$$ and $$4$$ only
C
$$2$$ and $$3$$ only
D
$$3$$ and $$4$$ only
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12