1. If matrix A is of order 3×4 and matrix B is 4 × 5. The number of multiplication
operations and addition operations needed to calculate the matrix product AB
(A) 240, 60 (B) 60, 45 (C) 60, 60 (D) 240, 32
2. The maximum value of the rank of a 4 × 5 matrix is
(A) 4 (B) 5 (C) 9 (D) None
3. Maximum number of edges in a nnode undirected simple graph without cycles is
(A) n  1 (B)
( ) 1
2
n n +
(C)
( ) 1
2
n n −
(D) n
4. The minimum number of colours required to color the following graph is:
(A) 1 (B) 2 (C) 3 (D) 4
5. For lattice
12
D ;divides
which is not true?
(A) Complement of 1 is 12 (B) Complement of 2 is 6
(C) Complement of 3 is 4 (D) Complement of 2&6 doesn´t exist
6. Which of the following statements is/are true?
i) Spanning tree will always have V  1 edge
ii) Adding an edge to the spanning tree always creates a cycle
iii) The intermediate graphs obtained from both prim´s and Kruskal´s algorithms
in finding minimum cost spanning tree are always trees
(A) only (i) (B) only (ii)
(C) both (i) and (ii) (D) all of the above
7. Which of the following statement is not correct?
(A) The complement of a recursive language is recursive
(B) The union of two recursive languages is recursive
(C) If a language L and it´s complement L1 are both recursively enumerable,
then L is recursive
(D) The union of two recursively enumerable languages is not recursively
enumerable
Page 2 of 18
8. Which of the following is not a valid deadlock prevention scheme?
(A) Release all resources before requesting a new resource
(B) Number the resources uniquely and never request a lower numbered
resource than the last one requested
(C) Requested and all required resources must be allocated before execution.
(D) None of the above
9. The Boolean function
' ' ' ' ' ' ' '
+ + + x y z xy z x yz xyz is equivalent to
(A)
'
x y (B)
'
xy
(C)
'
z
(D)
'
y
10. The performance of a pipelined processor suffers if
(A) There are instruction that change the sequence ordering of the program
(B) Consecutive instructions are dependent on each other
(C) The pipeline stages share hardware resources
(D) All of the above
11. How many 8bit characters can be transmitted per second over a 8800 baud
serial communication link using asynchronous mode of transmission with one
start bit, 8 data bits and two stop bits ?
(A) 1100 (B) 800 (C) 880 (D) 3000
12. Which of the following statement is true?
(A) The packet addressing should be taken care by data link layer
(B) Dividing the transmitted bit stream into frames is done by network layer
(C) The network addresses is block of addresses in the first address.The mask
can be ANDed with any address in the block to find the network address
(D) Both UDP and TCP are connectionless protocols
13. Let S and T be languages over { } , a b
represented by the regular expressions
( ) ( )
+
+ +
*
* * * *
and a b a b , which of the following is true?
(A) S ⊂ T (B) T ⊂ S (C) S = T (D) S∩T=(a
*
+b
*
)
14. Consider the following signed number (Negative number are represented in two´s
compliment form)
X = 11110101
Y = 00001000
Z = 11111110
What is the result of
( ) XY
Z
?
(A) 11010100 (B) 00101100 (C) 00011100 (D) 11011000
Page 3 of 18
15. If an edge with weight 5 is to be inserted in the following simple graph to get 2
minimal spanning trees then where should it be inserted?
(A) df
(B) de
(C) ce
(D) Not possible to get two minimal spanning trees
16. If n numbers are inserted into a binary search tree then which of the following
traversal outputs the numbers in sorted order?
(A) preorder (B) in order (C) post order (D)breadthfirst
A class B network address 130.50.0.0 is subnetted as follows. The last 10 bits of
the host id are allotted for host number and the remaining 6 bits are reserved for
subnet number.
17. How many subnets and number of hosts in each subnet are possible with the
above addressing scheme?
(A) 62, 1022 (B) 30, 510
(C) 14, 254 (D) None of the above
18. What are the starting addresses of 1
st
and 4
th
subnets?
(A) 130.50.4.1 and 130.50.16.1 (B) 130.50.1.1 and 130.50.4.1
(C) 130.50.0.0 and 130.50.3.0 (D) None of the above
19. The DAG shown here represents
(A) ( ) a b * c d + −
(B) a b * c *b * c d + −
(C) ( ) ( ) a b * c d + −
(D) ( ) ( ) a b * c * b * c d + −
20. Which of the following statement is true?
(A) SLR parser is more powerful than LALR
(B) LALR is more powerful than CLR parser
(C) Canonical LR parser is more powerful than LALR parser
(D) The parsers SLR, CLR & LALR have the same power
a
b
f
9
e
c
d
8
2
12
4
3
7
−
*
a
+
*
b c
d
Page 4 of 18
21. Which of the following statements is/are true?
S1: The transitive closure of the symmetric closure of a relation is the same as
the symmetric closure of the transitive closure of this relation.
S2: The transitive closure of the symmetric closure of a relation contains the
symmetric closure of the transitive closure of this relation.
(A) Only S1 (B) Only S2 (C) Both S1 and S2 (D) None
22. Consider the following functions from Z to Z, Z is set of integers
( )
( )
3
1
2
S : f x x is one to one but not on to
n
S : f n is on to but not one one
2
=
=
Which of the following is true?
(A)
1 2
S is true & S is false (B)
1 2
S is false & S is true
(C) Both are true (D) Both are false
23. The set { } G 0,1,2,3, 4,5 = is a group with respect to addition modulo 6.
Which of the following is false?
(A) The inverse of 2 is 4 (B) The inverse of 3 is 3
(C) The inverse of 1 is 5 (D) The inverse of 5 is 2
24. Consider the graph shown below
Which of the following is true?
(A) G is not Eulerian but Hamiltonian
(B) G is Eulerian but n´t Hamiltonian
(C) G is Eulerian and Hamiltonian
(D) G is neither Eulerian nor Hamiltonian
25. Which of the following arguments are valid
(i)
1
P : Babies are illogical
2
P : No body is despised who can manage a crocodile
3
P : Illogical people are despised
P : Babies cannot manage crocodile
Page 5 of 18
(ii)
1
P : All students are lazy
2
P : No student is healthy
P : Lazy people are not healthy
(A) (i) only (B) (ii) only (C) Both A & B (D) None
26. Given
( )
( ) ( )
( )
3 1 1
, and ,
4 3 3
P B P A B C P A B C P B C = ∩ ∩ = ∩ ∩ = ∩ =
(A)
1
12
(B)
1
9
(C)
1
15
(D)
1
18
27. If the following degree vertex, (5, 3, 2, 4, 3), can´t form a simple graph then
which of the following degree vertex should be added to make it form a simple
graph?
(A) 1 (B) 5
(C) 2 (D) None of the above
28. A six faced fair die is thrown until 1 comes, then the probability that 1 comes in
the even number of trails is:
(A)
5
11
(B)
5
6
(C)
6
11
(D) None
29. Evaluate
6
2
0
1
dx
x +
by Simpson´s
3
th
8
rule.
(A) 1.4262 (B) 1.3571 (C) 1.4056 (D) None
30. In a lottery, 2 tickets are drawn at a time out of 6 tickets numbered from 1 to 6.
The expected value of the sum of the numbers on the tickets drawn is
(A) 7 (B) 6 (C) 5 (D) 4
31. The following propositional statement is
( ) ( ) ( ) p r q r p q r → ∧ → → ∨ →
(A) Tautology (B) Contradiction
(C) Neither tautology nor contradiction (D) Not decidable
32. Which of the following statements is not true?
(A) If z is the set of integers and ï is the usual ordering on z, then [z; ï] is
partially ordered and totally ordered
(B) If z is the set of integers and ï is the usual ordering on z, then [z; ï] is
partially ordered but not totally ordered
(C) U be an arbitrary set and A = P(U) be the collection of all subsets of U. Then
[P(U); ⊆] is a poset
(D) If U contains more than one element then it is not totally ordered
Page 6 of 18
33. What does the following recurrence relation evaluates to?
1 0
3 where 1
n
n n
a a a
−
= + =
(A)
( )
3 1
2
n
−
(B)
( )
1
3 1
2
n+
−
(C)
( )
2
3 1
2
n+
−
(D)
( )
1
3 1
2
n−
−
34. Which of the following is true?
(A) The { } Poset P a,b, c, d, e = with hasse diagram is a lattice
(B) For the lattice { } x, a,b, y is a sub lattice
(C) The lattice is is distributive
(D) None of the above
35. If A, B and C are sets then which of the following is true?
a) (A B) C (A C)
b) (A C) (C B) (A B)
c) (B A) (C A) (B C) A
− − ⊆ −
− ∩ − = −
− ∪ − = ∪ −
(A) Only a and c (B) Only b and c
(C) Only a and b (D) All a, b, c
36. How many letters of six lowercase letters from the English alphabet contain the
letters p and q, where p is somewhere to the left of q in the string, with all the
letters distinct?
(A) 159,390 (B) 7,650,720
(C) 3,825,360 (D) None of the above
37. In which order the following numbers, 10, 3, 2, 4, 6, 7, 5, 1, should be inserted
in an empty binary search tree to get a search tree of height 5?
(A) 1, 2, 3, 6, 5, 7, 10, 4 (B) 1, 2, 3, 5, 10, 6, 7, 4
(C) 1, 2, 3, 4, 6, 7, 10, 5 (D) 1, 2, 3, 10, 4, 7, 6, 5
38. In which order the following numbers, 7, 5, 1, 8, 3, and 2, should be inserted
into an empty binary search tree to get in order and preorder traversal
sequences as same.
(A) 3, 2, 1, 8, 7, 5 (B) 8, 7, 5, 3, 2, 1
(C) 1, 2, 3, 5, 7, 8 (D) 3, 2, 8, 7, 5, 1
d
b
e
c
a
y
d
a
e
c
x
Page 7 of 18
39. If a queue is implemented using an array then what are the worst case time
complexities of both enqueue and dequeue operations
(A) O(1), O(n) (B) O(n), O(1) (C) O(1), O(1) (D)O(n), O(n)
40. If the following elements, 5, 3, 4, 2, 6, 7, and 1, are inserted into a max heap
then what is printed for an in order traversal of the heap
(A) 2, 5, 3, 7, 4, 6, 1 (B) 3, 5, 2, 7, 4, 6, 1
(C) 4, 6, 3, 7, 2, 5, 1 (D) 4, 6, 3, 7, 1, 5, 2
41. If the read/write head of a disk starts at track 100 and the disk has requests
pending to tracks 43, 158, 44, 203 and 175, what is the total number of tracks
that the read/write head will cross to satisfy these requests under the following
disk scheduling technique?
(a) FCFS (1) 263 tracks
(b) SSTF (2) 473 tracks
(c) LOOK (3) 217 tracks
(A) a2 b3 c1 (B) a1 b2 c3 (C) a2 b1 c3 (D) none
42. If we run Dijkstra´s single source shortest path algorithm on the following edge
weighted directed graph with vertex 5 as the source
In what order do the nodes get included into the set of vertices for which the
shortest path distances are finalized.
(A) A, B, D, C, E, H, G, F (B) A, B, D, C, E, F, H, G
(C) A, B, D, C, E, F, G, H (D) A, B, D, C, E, G, F, H
43. Consider the following C program
struct cellNode {
struct cellNode *leftChild;
int element;
struct cellNode *rightChild;
};
int value = 0;
void DoSomething (struct cellNode *ptr)
A
C
B
D
F
H
G
E
10
3
17
15
14 2
10
8
10
9
10
Page 8 of 18
{
if ( (ptr>leftChild == NULL) && (ptr>rightChild == NULL))
value++;
else {
if (ptr>leftChild)
DoSomething(ptr>leftChild);
if (ptr>rightChild)
DoSomething(ptr>rightChil(D);
}
}
What does "value¨ contain at the end of all calls when a pointer to the root of a
nonempty tree is passed as an argument
(A) The number of nodes in the tree
(B) The number of leaf nodes in the tree
(C) The number of internal nodes in the tree
(D) The height of the tree
44. What does the following function do?
void DoSomething (struct cellNode *ptr)
{
struct cellNode *tmpptr;
if (ptr) {
tmpptr = ptr>leftChild;
ptr>leftChild = ptr>rightChild;
ptr>rightChild = tmpptr;
if (ptr>leftChild)
DoSomething(ptr>leftChild);
if (ptr>rightChild)
DoSomething(ptr>rightChild);
}
(A) Swaps the left and right children of every node
(B) Swaps only the root and right children of intermediate nodes
(C) Swaps only the root and left children of intermediate nodes
(D) None of the above
45. Consider the following C program?
int f (int n)
{
if (n <= 1) return 1;
n = (n  1)
2
 2  n
2
+ 3 * n;
Page 9 of 18
f(n);
printf("%d ¨, n);
}
What is the output, if the initial call is f(6)
(A) 5 5 5 5 5 (B) 1 1 1 1 1 (C) 5 4 3 2 1 (D) 1 2 3 4 5
46. What is printed for the following c program?
void f(char *a)
{
a = (char *) malloc (10 * sizeof(char));
strcpy(a, "GATE2006¨);
}
int main()
{
char *str = "GATE¨;
f(str);
printf("%s¨, str);
}
(A) GATE (B) GATE2006
(C) Segmentation fault (D) None of the above
Consider the following program
int f (int n)
{
if (n == 0  n == 1) return 1;
else return f(n  1);
}
int main()
{
int i;
i = f(8);
printf("%d¨, i);
}
47. What is printed by the above C program?
(A) 8 (B) 1 (C) 36 (D) 40
48. What is the time complexity of the above function f?
(A) O(1) (B) O(log n) (C) O(n) (D) O(2
n
)
Page 10 of 18
49. How many states are possible in the smallest finite automata that accepts the
following language?
L = {x  x is a binary string with number of 0´s divisible by 2 and number 1´s
divisible by 3 }
(A) 6 (B) 5 (C) 3 (D) 2
50. If the following Automata has to accept the following language then which states
should be marked as final?
L = {w  w ∈ {a, b}
*
, w has an odd number of a´s and even number of b´s or w
has an odd number of b´s and even number of a´s}
(A)
1 3
& S S (B)
2 4
& S S (C)
1 2
& S S (D)
2 3
& S S
51. Let L denote the language generated by the grammar S → 00T, T →11S  11. If S
is the start symbol then which of the following is true?
(A) L = (0 + 1)
*
(B) L is regular but not (0 + 1)
*
(C) L is context free but not regular (D) L is not context free
52. Which of the following grammars violate Chomsky Normal Form
(i) S → AB, A → a, B → ∈  b
(ii) S → AcB, A → a, B → b
(iii) S → AB, A → a, B → b
(A) All of the above (B) (i) only
(C) (i) & (ii) only (D) (ii) & (iii) only
53. What is the equivalent CFL for the following 0 1 0 0 1 1 CFG S S S → ∈
(A) { x x is a palindrome (string reading same forward as backward)}
(B) { x x = 0 1
n n
for n ≥ 0}
(C) { x x has equal number of 0´s and 1´s }
(D) { x x = 1 0
n n
for n ≥ 0}
S2
S4 S3
S1
a a
b
b
a a
b
b
Page 11 of 18
54. Which language does the following PDA accept?
M = ({q
0
, q
1
}, {0, 1}, {Z
0
, X}, δ, q
0
, Z
0
, ∅ } and δ is given by
δ (q
0
, 1, Z
0
) = {(q
0
, XZ
0
)}, δ(q
0
, 1, X} = {(q
0
, XX)},
δ (q
0
, 0, X) = {(q
1
, X)}, δ (q
0
, ∈, Z
0
) = {(q
0
, ∈)},
δ (q
1
, 1, X) = {(q
1
, ∈)}, δ (q
1
, 0, Z
0
) = {(q
0
, Z
0
)}
(A) L = {1 01 0,
n n
where n ≥ 1} (B) L = {1 01 0,
n n
, where n ≥ 0}
(C) L = {1 01 ,
n n
, where n ≥ 1} (D) L = {1 01 ,
n n
, where n ≥ 0}
55. A Unix style Inode has 8 direct pointers, one single, one double and one triple
indirect pointers. Disk block size is 1KB, disk block address is 32 bits. What is the
maximum possible file size represented by triple indirect pointer?
(A)
24
2
bytes (B)
32
2
bytes (C)
34
2
bytes (D)
48
2
bytes
56. What is the average waiting time for the following jobs if preemptive SJF
scheduling algorithm is used?
Job Arrival Time Burst Time
J1 0 3
J2 1 3
J3 2 1
J4 3 2
(A) 2 (B) 1.75 (C) 1.5 (D) 2.25
57. Consider a machine with 128MB physical memory and a 32bit virtual address
space. If the page size is 2KB, what is the approximate size of the page table?
(A) 2MB (B) 4MB (C) 8MB (D) 16MB
58. The main memory size is assumed to be 4KB and the page size is 1KB. If LRU
(Least Recently Used) algorithm is used for page replacement then what pages
should reside in main memory at the end for the following sequence of page
references ?
4, 8, 2, 3, 2, 8, 3, 1, 2, 6, 7
(A) 1,6,2,7 (B) 2, 4, 7, 8 (C) 1, 2, 6, 7 (D) 1, 2, 3, 8
59. A circuit takes a number in the form of 4 bits. If the sum of bits is ≥ 3 then the
circuit outputs a 1. Otherwise it outputs a 0. If ninput AND gates, ninput OR
gates and 1input NOT gates are provided, what is the maximum number of
gates required to implement the circuit?
(A) 3 (B) 4 (C) 5 (D) 6
Page 12 of 18
60. Consider a multiplexer with X and Y as data inputs and Z as control input. Z = 0
selects input X and Z = 1 selects input Y. What are the connections required to
realize the 2variable Boolean function f = TR without using any additional H/W.
(A) Connect R to X, 1 to Y, and T to Z
(B) Connect R to X, 0 to Y, and T to Z
(C) Connect 0 to X, R to Y, and T to Z
(D) Connect 1 to X, R to Y, and T to Z
61. In the following circuit the initial value of X is 1 and P is 0 when the circuit is
initialized. A 0 on TRST resets the flipflop. What logic values should be applied to
get a `0´ on X?
(A) D = 0, P = 0 (B) TRST = 0, P = 0
(C) D = 1, P = 0 (D) None of the above
62. What is the minimum sum of product expression for ( ) , , , f w x y z shown in the
following Karnaughmap?
(A) zx z x ′ + (B) zx z x ′ ′ + (C) yx zx ′ ′ +
(D)
yx zx ′ +
63. Consider the following logic circuits whose inputs are functions
1 2 3
, , f f f and output
f is:
Given that ( ) ( ) ( ) ( ) ( ) ( )
1 2 3
, , 0,1,3,5 , , , 6,7 and , , 1, 4,5 f x y z f x y z f x y z = = =
P
D
D
CP
TRST
X
1
×
0
×
1
1
0
0
00 01 11 10
00
01
11
10
yz
wx
1
0 1
0 0 1
×
0
( )
1
, , f x y z
( )
2
, , f x y z
( )
3
, , f x y z
( ) , , f x y z
Page 13 of 18
CP
A4
A3
A2
A1
K
K
K K
J Q
J
Q J
Q
J
Q
J
What is ( ) , , f x y z ?
(A) ( ) 4
(B) ( ) 4,5
(C) ( ) 1, 4,5
(D) ( ) 6,7
64. If the initial values of =
4 3 2 1
0110, A A A A what are the outputs of
4 3 2 1
A A A A after CP
is triggered and the inputs (J, K) of all flip flops are tied to 1?
(A) 1001 (B) 0100 (C) 0111 (D) 0110
65. Consider the following relation schema.
Supplier(S#, Sname),
Parts(P#, Color)
Catalog (S#, P#, Cost)
select distinct Sname
from Suppliers
where S# in (select S#
from Catalog
where S# in (select P#
from Parts
where Color = `red´));
What does the above SQL query produces?
(A) Get supplier names for suppliers who supply only RED parts
(B) Get supplier names for suppliers who supply at least one red part
(C) Get supplier names for suppliers who do not supply red parts
(D) None of the above
66. A relation R is defined as R(S#, STATUS, CITY, SNAME) where S# is the primary
key. If R decomposed into two relations
1 2
and R R , which of the following is a
loseless decomposition?
(A)
1
R (S#, STATUS),
2
R (S#, CITY, SNAME)
(B)
1
R (S#, STATUS),
2
R (STATUS, CITY, SNAME)
(C)
1
R (S#, STATUS, CITY),
2
R (CITY, SNAME)
(D)
1
R (S#, STATUS, SNAME),
2
R (CITY, STATUS)
Page 14 of 18
67. R is a relation with attributes A, B, C, D and the following FDs:
A → BC, B → C, A → B, AB → C, AC → D
What is the equivalent irreducible set of FDs for the above set:
(A) A → B, B → C, A → D (B) A → B, B → C, A → C
(C) A → B, A → C, A → D (D) A → B, B → C, C → D
68. A relation NADDR is defined with attributes NAME (unique), STREET, CITY, STATE
and ZIP. For any given ZIP, there is just one CITY and STATE. What is the
highest normal form satisfied by above decomposition?
(A) 1NF (B) 2NF (C) 3NF (D) BCNF
Consider the following relation schema pertaining to a student´s database
student (rollno, name, courseno)
Enroll(rollno, courseno, coursename)
69. Where the primary keys are underlined. The number of tuples in the student and
Enroll tables is 30 and 40 respectively.
If the natural join is performed on rollno, what are the maximum and minimum
number of tuples that are possible ?
(A) 30, 30 (B) 120, 30 (C) 40, 30 (D) 120, 40
70. If the natural join is performed on courseno, what are the maximum and
minimum numbers of tuples possible?
(A) 30, 30 (B) 120, 30 (C) 40, 30 (D) 120, 40
71. A shift reduce parser carries out the actions specified with in braces immediately
after reducing with the corresponding rule of grammar
{ }
{ }
{ }
{ }
{ }
{ }
S AS pr int 1
S AB pr int 2
A a pr int 3
B bC pr int 4
B dB pr int 5
C c pr int 6
→
→
→
→
→
→
This syntax directed translation scheme translates a language whose terminal
symbols are a, b, c & d into another language whose terminal symbols are 1, 2,3,
4, 5, and 6 what is the translation of "aaadbc¨?
(A) 333546211 (B) 654211 (C) 333645211 (D) 645233311
Page 15 of 18
Consider the following grammar?
S Xa
X aXb
X a
→
→
→
72. Consider the following statements
S1: The above grammar is not in LL(1).
S2: The above grammar is not in SLR(1).
Which one of the following is true
(A) S1 is true S2 is false (B) S1 is false S2 is true
(C) Both are true (D) Both are false
73. Consider the following production
( )
( )
( )
1 X aa
2 X Xb
3 X b
→
→
→
which of the above production will generate reducereduce conflict when added to
grammar given in above question.
(A) (1) only (B) (2) only
(C) (3) and (1) only (D) (1) and (2) only
74. Consider following grammar
S aSb aAb aBb
A aA a
B Bb b
→
→
→
The language is
(A)
{ }
i j
ab /i j ≥ (B)
{ }
i j
ab / j i 1 ≥ + (C)
{ }
i j
ab / i j 1 − ≥ (D)
{ }
i j
ab /i j 1 ≥ +
75. The string which does not belong to the grammar is
(A) aabbb (B) aaabb (C) aaab (D) aabb
Page 16 of 18
76. Let us say that a queue is implemented using stacks.
What are the minimum number of stacks needed to represent it
(A) 1 (B) 2 (C) 3 (D) 4
77. For the above representation what are the time complexities of enqueue and
dequeue operations.
(A) O(1), O(n) (B) O(n), O(n)
(C) O(1), O(1) (D) None of the above
78. Suppose we want to synchronize two concurrent processes P and Q using binary
semaphores S, T and U.
Process P: Process Q:
P(S) W:
P(T) X:
P(U) Y:
Print `a´; print `a´;
Print `b´; print `b´;
V(S) A:
V(T) B:
V(U) C:
What statements should be written at W if no deadlock should occur?
(A) P(T)
(B) P(U)
(C) P(S)
(D) Not possible to avoid deadlock
79. What should be written at X and Y for the above problem?
(A) P(S), P(T) (B) P(T), P(U)
(C) P(S), P(U) (D) None of the above
Page 17 of 18
Consider the following assembly language program for a hypothetical processor.
A, B and C are 8 bit integers. The meanings of various instructions are shown as
comments.
MOV B, #0; B ← 0
MOV C, #8; C ← 8
Z: CMP C, #0; compare C with 0
JZX ; Jump to X if zero flag is set
SUB C, #1 ; C ← C  1
LRC A, #1 ; Left rotate A through carry by one bit. Thus if the
Initial value of A and the carry flag are a7a6.a0 and c0
Respectively, their values after the execution will be
a6a5.a0c0 and a7 respectively.
JC Y ; Jump to Y if carry flag is set
JMP Z ; Jump to Z
Y: ADD B, #1 ; B ← B + 1
JMP Z ; Jump to Z
X:
80. If the initial value of register A is A
0
, the value of register B after the program
execution will be
(A) The number of 0 bits in A (B) The number of 1 bits in A
(C) A
0
(D) 8
81. Which of the following instructions should be inserted at location X to ensure
that the value of register A after program execution is the same as its initial
value.
(A) NOP (B) LRC A, #1 (C) ADD A, #1 (D)RRC A, #1
82. The minimum number of nodes in an AVL tree of height h is,
(A) ( ) ( ) ( ) S h S h 1 S h 2 = − + − (B) ( ) ( ) ( ) S h S h 1 S h 2 1 = − + − +
(C) ( ) ( ) ( ) S h S h 1 S h 2 1 = − + − − (D) None
83. At least how many numbers of nodes are there in an AVL tree of height 4
(A) 11 (B) 15 (C) 10 (D) 12
Page 18 of 18
84. Which of the following function require the minimum number of NAND gates
required to implement?
(A) F AB C' = + (B) F A C = ⊕ (C) F ABC = (D) F B C =
85. What will be the required input to the following 4 to 1 Mux to realize the above
function?
(A)
0 1 2 3
I 0, I 0, I 0, I C = = = =
(B) = = = =
0 1 2 3
I C', I C', I C', I 1
(C)
0 1 2 3
I C, I C, I C', I C' = = = =
(D) = = = =
0 1 2 3
I C', I C, I C, I C'
B A
F
MUX
I0
I1
I2
I3
S1 S0
Page 1 of 11
Answer Key's
Explanation:
1. Let matrix A is of order m × n
Let matrix B is of order n × p
For matrix product AB,
The number of multiplication operations = mpn
The number of addition operations = mp(n  1)
Here m = 3, n = 4, p = 5
5. Let L be a bounded lattice with greatest element I and least element 0, and a∈L.
An element a´∈L is called a complement of a if ava' = I and a a'=0 ∧
Here I 12, 0 1 = =
6. (i) Consider the following graph
Spanning trees are:
1 B 2 A 3 A 4 C 5 B 6 D 7 D
8 D 9 C 10 D 11 B 12 C 13 C 14 B
15 D 16 B 17 A 18 A 19 D 20 B 21 B
22 C 23 D 24 A 25 A 26 A 27 A 28 D
29 B 30 A 31 A 32 B 33 B 34 B 35 A
36 C 37 A 38 C 39 A 40 A 41 A 42 B
43 B 44 A 45 D 46 A 47 B 48 C 49 A
50 B 51 B 52 C 53 A 54 A 55 C 56 B
57 B 58 A 59 C 60 C 61 B 62 B 63 A
64 A 65 B 66 A 67 D 68 B 69 A 70 B
71 C 72 C 73 D 74 C 75 D 76 B 77 A
78 C 79 B 80 B 81 B 82 B 83 D 84 A
85 B
12
1
2 3
4 6
Page 2 of 11
(ii) Adding an edge will always creates a cycle because there will be always a path from one vertex
to another where u will add the new edge.
(iii) Prim´s and Kruskal´s algorithm both will add only those edes that will not create cycle otherwise
it will no longer a tree.
7. Recursive enumrable are closed under Kleene star Concatenation, union and intersection.
8. (A) is the condition to avoid No preemption, (B) is the condition to avoid Circular wait (C) is the the
condition to avoid hold and wait.
9.
10. Pipelined suffers from different hazard, (A) describe control hazard (B) is data hazard and (C) is
structure hazard; All affects the performance of pipeline.
11. Each character takes 1 + 8 + 2 = 11 bits to transfer. The baud rate is 8800, i.e., 8800 bits per
second. So 800 characters can be transmitted per second
12. The packet addressing should be taken care by network layer (IP), dividing the transmitted bit in to
frames is done by data link layer and only UDP is connectionless protocol.
13. Both the regular expressions are equivalent to (a + b)*. So S = T
14. X = 11, Y = 8 and Z = 2. So
( ) XY
Z
= 44 = 00101100 (binary)
15. At least 2 edges should have same weight to get multiple minimum spanning trees. Here we are not
adding any duplicate weighted edge to the graph. So it is not possible to get more than one minimal
spanning tree.
16. According to the binary search tree the left child value should always be less than root node value and
the right node value should always be greater than the root node. So, the tree should be visited in in
order to get the numbers in ascending order.
17. There are 6bits for subnet, but we have to remove the first(all zeros) and last (all once)combinations
for both subnet and host id´s.
18. 130.50. .
In this 16 the first 6 are for subnet address and the remaining 10 are for host ids. We shouldn´t take
the first combination of 130.50.
binary
00000000.00000000
So the second choice is 130.50.
both are in binary
00000100.00000001
So the first subnet address is 130.50.4.1 and the 4
th
subnet address is 130.50.00010000.00000001
which is nothing but 130.50.16.1.
x
yz
00 01 11 10
0
1
1
1
1
1
8 bits
8 bits
Page 3 of 11
21. Counter example: R = {(a,b) (a,c)}. The transitive closure of the symmetric closure of R is {(a,a)
(a,b) (a,c) (b,a) (b,b) (b,c) (c,a) (c,b)}. The symmetric closure of the transitive closure of this
relation is {(a,b) (a,c) (b,a) (c,a)}
22. ( )
3
1
S : f x x on 2 =
For any two integers a, b
( ) ( )
3 3
f a f b a b a b = ¬ = ¬ =
Two diff elements have two diff images
it is 1 1 ∴ −
( )
1
3
3
y f x x , x y need n' t be int eger
it is not on to
= = =
∴
23.
24. Not Eulerian as edge repetition is there.
But is Hamiltonian
26. ( ) ( ) ( ) ( )
1
12
∩ = − ∩ ∩ − ∩ ∩ = P B C P B P A B C P A B C
27. First sort the degree vertex which gives us (5, 4, 3, 3, 2). Let label these vertices as (a, b, c, d, e)
respectively and the new vertex (to be added) as `f´. The vertex `a´ (degree 5) should be adjacent to 5
vertices. This means `f´ vertex should have a degree of at least 1. The second vertex should be
adjacent to another 3 vertices as vertex `a´ is already adjacent to this contributing 1 degree. We will
take these 3 vertices as (c, d, e). The vertex `c´ should be adjacent to another vertex as `a´ and `b´ are
already adjacent to this. This we can take as `d´. With this all degrees are satisfied for all vertices. So
the new vertex `f´ should have a degree of 1.
28. The required probability =
3
1 5 1 5
. .
6 6 6 6
 
+ +

\ .
2
1 5 5
. 1
6 6 6
(
 
= + + (

\ . (
¸ ¸
29.
By Simpson´s
3
8
rule
6
0 1 2 3 4 5
0 0 1 2 3 4 5
1 1 2 3 4 5 0
2 2 3 4 5 0 1
3 3 4 5 0 1 2
4 4 5 0 1 2 3
5 5 0 1 2 3 4
+
x 0 1 2 3 4 5 6
f(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.027
y0 y1 y2 y3 y4 y5 y6
Page 4 of 11
( ) ( )
6
0 6 1 2 4 5 3 2
0
3
3 2 1.3571
1 8
( = + + + + + + =
¸ ¸
+
}
dx h
y y y y y y y
x
30. Let x1, x2 , .. Be the variables representing the numbers on the first, second, .. 6
th
ticket. The
probability of drawing a ticket out of 6 tickets is
1/6+ 2. 1/6+ 3.1/6 +4. 1/6 + 5. 1/6 + 6. 6/6=7/2
Expected value of the sum of the numbers on the tickets drawn = E( x1+ x2)= E(x1) + E(x2) = ½ 2.
( 6+1) = 7
31. If we have to prove that it is a contradiction then ( ) ( ) ( → ∧ →
¸ ¸
p r q r should be true and
( ) ( ∨ →
¸ ¸
p q r should be false. Then only the given preposition become false. In all other cases it is
true according to the definition of "¨ operator. Let us take ( ) ( ) ( → ∧ →
¸ ¸
p r q r as preposition (1) and
( ) ( ∨ →
¸ ¸
p q r as preposition (2).
Preposition (2) is false only if
( ) ( )
( )
3
4
p q T
r F
∨ −
−
Preposition (1) is true only if ( ) ( ) and p r q r → → both are true. But r is false according to the equation
(4). So p and q both should be false to make ( ) ( ) and p r q r → → True which doesn´t satisfy equation
(3). So the given preposition is a tautology.
33.
1
3
−
= +
n
n n
a a
( )
( )
( )
1 2 1
1 2 2 3 1 0
1
1
0 1 2 2 1
3 , 3 , 3
1 3 1
3 1
3 3 3 3 3 3
2 2
− −
− − − −
+
+
− −
= + = + = +
−
−
= + + + + + + = =
n n
n n n n
n
n
n n n
n
a a a a a a
a
34. (A) is not true because dve doesn´t exist.
In case of (C),
( )
( ) ( )
a c d
a I a
a c a d
0 0 0
Hence not distributive.
∧ ∨
= ∧ =
∧ ∨ ∧
= ∨ =
35. Suppose x (A B) C ∈ − − . Then x is in AB but not in C. Since x (A B) ∈ − , x A but x C ∈ ∉ , hence
x (A C) ∈ −
b) Let x (A C) (C B) ∈ − ∩ − . Then x (A C) and x (C B) ∈ − ∈ −
Hence x C and also x C ∈ ∉ , which is contradictory.
36. First choose the position for p and q; this can be done in C(6,2) ways, since once we pick two
positions, we put p in the leftmost and q in the other. The four remaining positions can be filled in
P(24,4) ways.
Hence answer is C(6,2)P(24,4)
c
0
I
a d
Page 5 of 11
37.
38. The choice (C) gives the following binary search tree in which both in order and preorder traversals
are same. The sequence should always be in increasing or decreasing order to get such property.
39. Enqueue operation is O(1) and in Dequeue all the remaining element have to be shifted so O(n).
1
2
3
6
5
4
7
10
1
2
3
4
5
6
10
6
7
1
2
3
6
5
4
7
10
1
2
3
4
6
7
5
10
1
2
3
5
7
8
Page 6 of 11
40. Follow the heap insertion algorithm and do an inorder traversal on the constructed heap.
41. FCFS 1
st
goes to 43 track
requests are handled in order of arrival
¬ total no of tracks = 473
SSTF 1
st
goes to track 44
total no of tracks = 217 tracks
sequence is 44, 43, 158, 175, 203.
Look 1
st
158
total no of racks = 263 tracks.
42. Include vertex Rechable vertex A B C D E F G H
{ } {A} B, C
{ } { }
{ } { }
{ } { }
{ } { }
{ } { }
{ } { }
{ }
A,B D,E
A,B,D E
A,B,D, C F
A,B,D, C,E G
A,B,D, C,E,F G,H
A,B,D, C,E,F,H G
A,B,D, C,E,F,H, G
43. The program does a simple `preorder´ traversal on the graph. The `value´ is incremented whenever
both left and right child are NULL. So, the program finds out the number of leaves in the given graph.
44. There is no condition while swapping the links. So it swaps the left and right children of every node.
46. The write happened in function f gets destructed as soon as the function call is over. So, it prints the
previous value of `GATE´.
48. The function corresponds to the recursive equation
1
1.
−
= +
n n
f f By solving this we get O(n),
4
5
2
3
6
4
5
2
6
3
4
6
2
5
3 7
7
6
2
5
3 4
6
7
2
5
3 4 1
2 15
2
2
2
2
2
2
2
12
12
12
12
12
12
12
11
11
11
11
11
11
11
16
16
16
16
16
16
16
22
22
22
22
22
33
32
32
32
32
32
32
Page 7 of 11
49. To have a FA to check for divisibility by two we should have two states. To check for the divisibility by
3 we need 3 states. In the final FSM the states consist of the combination of FSM1, and FSM2. So the
final FSM would have 6 states.
50. State S4 denotes `odd number of a´s and even number of b´s.
S3  odd number of a´s and odd number of b´s.
S2  even number of a´s and odd number of b´s.
S1  even number of a´s and even number of b´s.
So both S2 and S4 should be marked as final to accept the given language.
51. The given grammar generates the following regular expression ( ) 0011 .
+
So L is regular but not ( )
*
0 1 +
52. The first choice has∈. In the second choice the rule S→AcB is not compliant to CNF
53. The given CFG defines a palindrome
Consider the following string 0001111111000
S 0S0 00S00 000S000 0001S1000 00011S11000 000111S111000 0001111111000 ¬ ¬ ¬ ¬ ¬ ¬ ¬
55. Block size is 1KB and block address is 32 bits
10 3
5
2 ×2 bits
Number of entries = =256
2 bits
34
Triple indirection will Point 256×256×256×1KB=2 Byte
56. This is the order in which the jobs are processed.
J1 J1 J1 J3 J4 J4 J2 J2 J2
So the average waiting time is =
0 1 1 5
1.75
4
+ + +
=
57.
CPU p d f
d
Logical address Physical address
Physical
memory
Page
Table
f
s 0 1
0 00 01
1 01 11
00 0 1
01 1 011
11 011 00
011 11 0
111 0 1
State 0 1
Q Q Q
Q Q Q
Q Q Q
Q Q Q
Q Q Q
Q Q Q
Q Q Q
Q Q Q
These three sate will combine
Page 8 of 11
Both p+d = 32 and f+d=27 as 128 MB of physical memory is there. In this`d´ takes 11 bits as page
size is 2 KB. So p becomes 21 and f becomes 16. With these parameters the page table size becomes
21 4
2 2 bits × 4 = MB (approximately ignoring other information bits that are present like dirty bit)
58. After first Four References
When `1´ comes `4´ becomes the LRU page. So we replace it with (1).
¹
¹
59. Truth table
w x y z A
0 0 0 0 0
0 0 0 1 0
0 1 1 1 1
1 0 1 1 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
For all other values it is `0´. Solve it using Karnaugh map to get a Boolean equation. Then the number
of minterms and the number of complements gives the required number of gates.
60.
61. The output of Dflipflop should be `1´ if P = 0 and X = 1. So the flip flop should be reset, i.e. P = 0
and TRST = 0 to get a `0´ on X.
63. The output of OR gate comes out as ( ) 0,1,3,5,6,7
¿
. The negation of this gives us ( ) 2, 4 .
¿
The
output of AND gate should be the common minterms between ( ) 2, 4
¿
and ( ) 1, 4,5
¿
which is =
( ) 4 .
¿
4 8 2 3
1 8 2 3
1 6 2 3
1 6 2 7
O
R
T
f
x
y
z
2×1
MUX
Page 9 of 11
64. If J and K are tied to `1´ then the output is always complemented. When CP is triggered A1 becomes 1.
This triggers the second flipflop as CP is going from 0 to 1. The other flip flops are also triggered in
the similar fashion. So the output is 1001.
66.
1 2
If a relation R is decompose in to R andR
1 2 1 2 1 2 2 1
(R R ) R R ,(R R ) R R to make the decomposition lossless ∩ → − ∩ → −
67. Consider the set
A B...1,B C...2,C D...3
from1 and 2 A C....4
from1 and 4 A BC
from2 and 4 AB C
from3 and 4 A D.....5
from3and 5 AC D
→ → →
→
→
→
→
→
68. Since name is unique so name is primary key; Also zip is determining city and state so non key to non
key dependency exists hear and given reation is not in 3NF so highest normal form satisfied by given
relation is 2NF.
69. As the roll number is a primary key it is different for all entries in both student and enroll databases,
so the join is always the minimum of both the tables entries.
70. Here course number is not a primary key. So there could be a chance that course number is same for
all the entries in both the tables which gives us the maximum value of 120. If it is distinct as in (a)
then it gives the minimum of 30.
71. A As as aAs aas aaAB aaaB → → → → → →
aaadB aaadbC aaadbc → → →
A
a
( ) print 3
S
( ) print 1
S
A S
a ( ) print 3
B
( ) print 2
A
a ( ) print 3
B ( ) print 5
d
a
C
( ) print 4
c ( ) print 6
Page 10 of 11
72. The above grammar is not in LL(1) because [X,a] will contain multiple entry and not even in SLR(1).
73.
76. Two stacks are needed.
77. Enqueue operation is done by the PUSH operation on stack 1. Dequeue is done by popping all
elements on to STACK 2 and then returning the top element. All the elements have to be moved back
to STACK1 to retain correct state. We can think of reducing the number of element movements. But it
can never be less than n. so enqueue takes O(1) time and dequeue takes O(n) time
78. If we write P(T) then x or y should have p(s). in any case there is a chance that process p acquires s
and waits for T. And, process Q acquires T and waits for S in which case the deadlock occurs. Similar
is the case with p(U). If it is P(S) then only one of P or Q can acquire it and proceed further.
79. Can be P(T), P(U) or P(U), P(T)
81. All bits are shifted left through carry except the last bit. So last bit should also be shifted through
carry to retain it´s initial value.
X
X
S
→
→
→
→
S' .S
S .Xa
X .aXb
X .a
→
→
→
→
X a.Xb
X a.
X .aXb
X .a
X aX b → ⋅
S' S → ⋅
a
a
S X.a →
ShiftReduce conflict
X
X
S
S' .S
S .Xa
X .aXb
X .a
X .aa
→
→
→
→
→
→
→
→
→
→
→
X a.Xb
X a.
X a.a
X .aXb
X .a
X .aa
X aX b → ⋅
S' S → ⋅
a
a
→
→
→
→
X aa.
X a.Xb
X a.
X a.a
.
.
.
S X.a →
ReduceReduce conflict
Page 11 of 11
83. S(4)=S(3)+S(2)+1
=[S(2)+S(1)+1]+[S(1)+S(0)+1]+1
=[[S(1)+S(0)+1]+S(1)+1]+[S(1)+S(0)+1]+1
=[[2+1+1]+2+1]+[2+1+1]+1=12
84.
85.
c
B
A
A B +
( ) AB C' +
1 1 1
10 11 01 00
AB
C
0
1
1
0 1 0 0
1 C´ C´ C´