1
GATE CSE 2015 Set 1
Numerical
+2
-0
Consider the following C program segment.
while(first <= last)
{
if (array[middle] < search)
first = middle + 1;
else if (array[middle] == search)
found = TRUE;
else last = middle - 1;
middle = (first + last)/2;
}
if (first > last) notPresent = TRUE;
The cyclomatic complexity of the program segment is ________.Your input ____
2
GATE CSE 2015 Set 3
MCQ (Single Correct Answer)
+2
-0.6
Consider three software items: Program-$$X,$$ Control Flow Diagram of Program-$$Y$$ and Control Flow Diagram of Program-$$Z$$ as shown below
The values of McCabe’s Cyclomatic complexity of Program-$$X,$$ Program-$$Y,$$ and Program-$$Z$$ respectively are
3
GATE CSE 2015 Set 2
MCQ (Single Correct Answer)
+2
-0.6
Which one of the following assertions concerning code inspection and code walk-through is true?
4
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\}$$
$$\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} $$
If array $$A$$ is made to hold the string $$''abcde'',$$ which of the above four test cases will be successful is exposing the flaw in this procedure?
Questions Asked from Software Engineering (Marks 2)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages