GATECS2005
Question 1 
int ( * f) (int * ) ;
A function that takes an integer pointer as argument and returns an integer.  
A function that takes an integer as argument and returns an integer pointer.  
A pointer to a function that takes an integer pointer as argument and returns an integer.  
A function that takes an integer pointer as argument and returns a function pointer

Discuss it
int ( * f) (int * )Since there is no innermost bracket, so first we take declaration name f, so print “f” and then go to the right, since there is nothing to parse, so go to the left. There is * at the left side, so print “*”.Come out of parenthesis. Hence postfix notation of given declaration can be written as follows:
f * (int * ) intMeaning: f is a pointer to function (which takes one argument of int pointer type) returning int . Refer http://www.geeksforgeeks.org/complicateddeclarationsinc/ This solution is contributed by Nirmal Bharadwaj.
Question 2 
Same as an abstract class  
A data type that cannot be instantiated  
A data type type for which only the operations defined on it can be used, but none else  
All of the above 
Discuss it
Question 3 
both are procedural languages  
both are based on λcalculus  
both are declarative  
both use Hornclauses 
Discuss it
Question 4 
(i) and (ii) only  
(i) and (iv) only  
(i), (ii) and (iv) only  
(i), (iii) and (iv) only 
Discuss it
Question 5 
An array of 50 numbers  
An array of 100 numbers  
An array of 500 numbers  
A dynamically allocated array of 550 numbers 
Discuss it
Question 6 
Graph G has no minimum spanning tree (MST)  
Graph G has a unique MST of cost n1  
Graph G has multiple distinct MSTs, each of cost n1  
Graph G has multiple spanning trees of different costs 
Discuss it
Question 7 
O (n)  
O (n log n)  
O(n^{3/2})  
O(n^{3}) 
Discuss it
Question 8 
X = Y  
X ⊂ Y  
Y ⊂ X  
none of these 
Discuss it
Question 9 
not a lattice  
a lattice but not a distributive lattice  
a distributive lattice but not a Boolean algebra  
a Boolean algebra 
Discuss it
It is a lattice but not a distributive lattice. Table for Join Operation of above Hesse diagram V a b c d e ________________ a a a a a a b a b a a b c a a c a c d a a a d d e a b c d e Table for Meet Operation of above Hesse diagram ^ a b c d e _______________ a a b c d e b b b e e e c c e c e e d d e e d e e e e e e e Therefore for any two element p, q in the lattice (A,<=) p <= p V q ; p^q <= p This satisfies for all element (a,b,c,d,e). which has 'a' as unique least upper bound and 'e' as unique greatest lower bound. The given lattice doesn't obey distributive law, so it is not distributive lattice, Note that for b,c,d we have distributive law b^(cVd) = (b^c) V (b^d). From the diagram / tables given above we can verify as follows, (i) L.H.S. = b ^ (c V d) = b ^ a = b (ii) R.H.S. = (b^c) V (b^d) = e v e = e b != e which contradict the distributive law. Hence it is not distributive lattice. so, option (B) is correct.
Question 10 
6  
8  
9  
13 
Discuss it
Question 11 
12  
8  
Less than 8  
More than 12 
Discuss it
Question 12 
A) f(b  a) B) f(b)  f(a) C) D)
A  
B  
C  
D 
Discuss it
Question 13 
3 and 13  
2 and 11  
4 and 13  
8 and 14 
Discuss it
For a number 'n', (n) x (n') = I, where
n' = inverse of 'n' I = Identity element Now, the identity element for multiplication is 1. So, we need to find two numbers 'm' and 'n' such that (4 x m) % 15 = 1 and (7 x n) % 15 = 1,
where 'm' is the inverse of 4 and 'n' is the inverse of 7, and both 'm' and 'n' belong to the given set. Thus, from the given set, it can be easily identified by putting values that m = 4 and n = 13. So, C is the correct choice.
Please comment below if you find anything wrong in the above post.
Question 14 
ambiguous  
leftrecursive  
rightrecursive  
an operatorgrammar 
Discuss it
Question 15 
f is independent of X  
f is independent of Y  
f is independent of Z  
None of X, Y, Z is redundant 
Discuss it
Question 16 
 2^{n  1} to (2^{n  1}  1)  
 (2^{n  1}  1) to (2^{n  1}  1)  
 2^{n  1} to 2^{n  1}  
 (2^{n  1} + 1) to (2^{n}^{  1 }+ 1) 
Discuss it
Question 17 
1AF  
D78  
D71  
32F 
Discuss it
 0001 =1
 1010 =A
 1111 =F
Question 18 
BC'D' + A'C'D + AB'D  
ABC' + ACD + B'C'D  
ACD' + A'BC' + AC'D'  
A'BD + ACD' + BCD' 
Discuss it
Question 19 
Neither vectored interrupt nor multiple interrupting devices are possible.  
Vectored interrupts are not possible but multiple interrupting devices are possible.  
Vectored interrupts and multiple interrupting devices are both possible.  
Vectored interrupt is possible but multiple interrupting devices are not possible. 
Discuss it
Question 20 
I/O protection is ensured by operating system routine (s)  
I/O protection is ensured by a hardware trap  
I/O protection is ensured during system configuration  
I/O protection is not possible 
Discuss it
Question 21 
Saving temporary html pages  
Saving process data  
Storing the superblock  
Storing device drivers 
Discuss it
Question 22 
Virtual memory increases  
Larger RAMs are faster  
Fewer page faults occur  
Fewer segmentation faults occur 
Discuss it
Question 23 
TCP, but not UDP  
TCP and UDP  
UDP, but not TCP  
Neither TCP, nor UDP 
Discuss it
Question 24 
Finding the IP address from the DNS  
Finding the IP address of the default gateway  
Finding the IP address that corresponds to a MAC address  
Finding the MAC address that corresponds to an IP address 
Discuss it
Question 25 
2^n  
2^(n1)  
2^n – 1  
2^(n2) 
Discuss it
Question 26 
For shortest path routing between LANs  
For avoiding loops in the routing paths  
For fault tolerance
 
For minimizing collisions 
Discuss it
Question 27 
255.255.0.0  
255.255.64.0  
255.255.128.0  
255.255.252.0

Discuss it
Question 28 
Database relations have a large number of records  
Database relations are sorted on the primary key  
B+ trees require less memory than binary search trees  
Data transfer from disks is in blocks 
Discuss it
Question 29 
BCNF is stricter than 3NF  
Lossless, dependencypreserving decomposition into 3NF is always possible  
Lossless, dependencypreserving decomposition into BCNF is always possible  
Any relation with two attributes is in BCNF 
Discuss it
Question 30 
s ⊂ r  
r ∪ s  
r ⊂ s  
r * s = s 
Discuss it
Question 31 
void foo(int n, int sum) { int k = 0, j = 0; if (n == 0) return; k = n % 10; j = n / 10; sum = sum + k; foo (j, sum); printf ("%d,", k); } int main () { int a = 2048, sum = 0; foo (a, sum); printf ("%d\n", sum); getchar(); }What does the above program print?
8, 4, 0, 2, 14  
8, 4, 0, 2, 0  
2, 0, 4, 8, 14  
2, 0, 4, 8, 0 
Discuss it
Question 32 
double foo (double); /* Line 1 */ int main() { double da, db; // input da db = foo(da); } double foo(double a) { return a; }The above code compiled without any error or warning. If Line 1 is deleted, the above code will show:
no compile warning or error  
some compilerwarnings not leading to unintended results  
some compilerwarnings due to typemismatch eventually leading to unintended results  
compiler errors 
Discuss it
Question 33 
9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95  
9, 10, 15, 22, 40, 50, 60, 95, 23, 25, 27, 29  
29, 15, 9, 10, 25, 22, 23, 27, 40, 60, 50, 95  
95, 50, 60, 40, 27, 23, 22, 25, 10, 9, 15, 29 
Discuss it
Question 34 
10, 8, 7, 5, 3, 2, 1  
10, 8, 7, 2, 3, 1, 5  
10, 8, 7, 1, 2, 3, 5  
10, 8, 7, 3, 2, 1, 5 
Discuss it
Question 35 
5  
14  
24  
42 
Discuss it
Question 36 
nk  
(n  1)k + 1  
n(k  1) + 1  
n(k  1) 
Discuss it
Thus, T(n) = T(n1)  1 + k = T(n1) + k 1 = T(n2) + 2*(k1) Solving By Substitution Method = T(n3) + 3*(k1) . . . = T(n(n1)) + (n1)*(k1) = T(1) + (n1)*(k1) = k + (n1)*(k1) Forming Base Case : T(1) = k = n(k – 1) + 1In Gate, we will suggest you to solve this question by taking 23 examples and eliminating the options. But in the interviews later, you might have to show them how you form and solve the recurrence relation. This explanation has been contributed by Pranjul Ahuja. Visit the following link to learn more on recurrence relation: MIT Video Lecture on Asymptotic Notation  Recurrences  Substitution, Master Method
Question 37 
T(n) = O(n^{2})  
T(n) = θ(n log n)  
T(n) = Ω(n^{2})  
T(n) = O(n log n) 
Discuss it
Question 38 
O( V 2)  
O ( E  +  V  log  V )  
O ( V  log  V )  
O (( E  +  V ) log  V ) 
Discuss it
Question 39 
O(n log log n)  
θ(n log n)  
Ω(n log n)  
Ω(n3/2) 
Discuss it
Question 40 
X ≡ Y  
X → Y  
Y → X  
¬ Y → X 
Discuss it
Answer : [ B ] X = (P ⋁ Q) → R = ~(P ⋁ Q) ⋁ R = (~P ⋀ ~Q) ⋁ R = (~P ⋁ R) ⋀ (~Q ⋁ R) = (P → R) ⋀ (Q → R) X → Y is true as (A ⋀ B) → (A ⋁ B) is always TRUE but reverse implication is not always true.
Question 41 
∀(x) [teacher (x) → ∃ (y) [student (y) → likes (y, x)]]  
∀ (x) [teacher (x) → ∃ (y) [student (y) ^ likes (y, x)]]  
∃ (y) ∀ (x) [teacher (x) → [student (y) ^ likes (y, x)]]  
∀ (x) [teacher (x) ^ ∃ (y) [student (y) → likes (y, x)]] 
Discuss it
Question 42 
R ∪ S, R ∩ S are both equivalence relations  
R ∪ S is an equivalence relation  
R ∩ S is an equivalence relation  
Neither R ∪ S nor R ∩ S is an equivalence relation 
Discuss it
Question 43 
f and g should both be onto functions.  
f should be onto but g need not be onto  
g should be onto but f need not be onto  
both f and g need not be onto 
Discuss it
Given that, f: B → C and g: A → B and h = f o g. Note that the sign o represents composition. h is basically f(g(x)). So h is a function from set A to set C. It is also given that h is an onto function which means for every value in C there is a value in A.We map from C to A using B. So for every value in C, there must be a value in B. It means f must be onto. But g may or may not be onto as there may be some values in B which don't map to A. Example :
Let us consider following sets A : {a1, a2, a3} B : {b1, b2} C : {c1} And following function values f(b1) = c1 g(a1) = b1, g(a2) = b1, g(a3) = b1 Values of h() would be, h(a1) = c1, h(a2) = c1, h(a3) = c1 Here h is onto, therefore f is onto, but g is onto as b2 is not mapped to any value in A.Given that, f: B → C and g: A → B and h = f o g.
Question 44 
4  
6  
16  
24 
Discuss it
a = c mod 3 (given) Thus, ‘a’ can be any one of these values : 0, 1, 2
b = d mod 5 (given) Thus, ‘b’ can be any one of these values : 0, 1, 2, 3, 4
Thus, ordered pair for (a, b) are : (0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4)
Therefore, ordered pair (a, b) has 15 combinations and ordered pair (c, d) has 1 combination. Total combinations = 15 + 1 = 16
Hence, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 45 
P3 is decidable if P1 is reducible to P3  
P3 is undecidable if P3 is reducible to P2  
P3 is undecidable if P2 is reducible to P3  
P3 is decidable if P3 is reducible to P2's complement 
Discuss it
1. If A ≤_{p} B and B is decidable then A is also decidable. This is because if there exists a specific algorithm for solving B and we can also reduce A to B then we can have a solution of A as well. Hence A is decidable. However the reverse is not true i.e. if A ≤_{p} B and A is decidable then B is also decidable because A can have an algorithm existing for its correct solution but might be the case that B does not. 2. If A ≤_{p} B and A is undecidable then B is also undecidable. This is because if A is undecidable even when it can be reduced to B that simply reflects even B cannot provide an algorithm by which we can solve B and hence A. So decision problem B is also undecidable.However the reverse is not true here as well i.e. if A ≤_{p} B and B is undecidable then A is also undecidable because there might exist an algorithm for A that can provide a solution to A. Using the above stated conclusions we can say that option 1, 2 and 4 are false and option 3 is true.
Option 1: P1 ≤_{p} P3 and given P1 is decidable gives no conclusion for P3. Option 2: P3 ≤_{p} P2 and given P2 is undecidable gives no conclusion for P3. Option 3: P2 ≤_{p} P3 and given P2 is undecidable gives conclusion for P3 to be undecidable. Option 4: P3 ≤_{p} P2’s complement and given P2 is undecidable therefore P2’s complement is also undecidable gives no conclusion for P3.This explanation is contributed by Yashika Arora. Visit the following articles to learn more: undecidabilityandreducibility Wikipedia: Reduction_(Complexity)
Question 46 
a group  
a monoid but not a group  
a semigroup but not a monoid  
neither a group nor a semigroup 
Discuss it
Question 47 
G1  
G2  
G3  
G4 
Discuss it
Question 48 
no solution  
a unique solution  
more than one but a finite number of solutions  
an infinite number of solutions 
Discuss it
2 1 3 3 2 5 1 4 1
Question 49 
1 and 1  
1 and 6  
2 and 5  
4 and 1 
Discuss it
2λ 1 4 5λWe get the equation as λ^{2} 7 λ + 6 = 0 which gives us eigenvalues as 6 and 1.
Question 50 
i  
i+1  
2i  
2^{i} 
Discuss it
S = 1 + 2x + 3x^{2} + 4x^{3} + .......... Sx = x + 2x^{2} + 3x^{3} + .......... S  Sx = 1 + x + x^{2} + x^{3} + .... S  Sx = 1/(1  x) [sum of infinite GP series with ratio < 1 is a/(1r)] S = 1/(1  x)^{2}
Question 51 
(i) Select a box (ii) Choose a ball from the selected box such that each ball in the box is equally likely to be chosen. The probabilities of selecting boxes P and Q are (1/3) and (2/3), respectively.Given that a ball selected in the above process is a red ball, the probability that it came from the box P is
4/19  
5/19  
2/9  
19/30 
Discuss it
The probability of selecting a red ball = (1/3) * (2/5) + (2/3) * (3/4) = 2/15 + 1/2 = 19/30 [Let it be P1] Probability of selecting a red ball from box P = (1/3) * (2/5) = 2/15 [Let it be P2] Given that a ball selected in the above process is a red ball, the probability that it came from the box P is = P1/P2 = (2/15) / (19/30) = 4/19
Question 52 
1/2^{n}  
1  (1/n)  
(1/n!)  
1  (1/2^{n}) 
Discuss it
Question 53 
{w ∈ {a, b}* / every a in w is followed by exactly two b's}  
{w ∈ {a, b}* every a in w is followed by at least two b’}  
{w ∈ {a, b}* w contains the substring 'abb'}  
{w ∈ {a, b}* w does not contain 'aa' as a substring} 
Discuss it
Here w ∈ {a, b}* means w can be any string from the set of {a, b}* and {a, b}* is set of all strings composed of a and b (any string of a and b that you can think of) like null, a, b, aaa, abbaaa, bbbbb, aaaaa, aaaabbbbaabbababab etc.
These type of questions are frequently asked in GATE, where it is asked to choose best fit language among the options. To slove the question like this, there is a better way, we try to eliminate wrong options by choosing testing strings intelligently until we are left with one right option.As given in question, let’s we try to eliminate option (A), it recognizes only those string (composed of a and b) in which every a in w is followed by exactly two b’s , so if we take string abbb(three b’s), then it is accepted by machine , so this options is wrong. Now we try to eliminate option (C), it recognizes only those strings(composed of a and b) in which w contains the substring ‘abb’, so if we take string abbaa (has substring abb), then it is not accepted by machine, so this options is also wrong. Now we try to eliminate option (D), it recognizes only those string(composed of a and b) in which w does not contains ‘aa’ as a substring , so if we take string abbaba(‘aa’ not as a substring), then it is not accepted by machine ,so this options is also wrong. Only option with which we are left, is option (b) in which every a in w is followed by at least two b’ ,is correct.So answer is option (B).
This solution is contributed by Nirmal Bharadwaj.
Question 54 
Df ⊂ Nf and Dp ⊂ Np  
Df ⊂ Nf and Dp = Np  
Df = Nf and Dp = Np  
Df = Nf and Dp ⊂ Np 
Discuss it
Question 55 
L1 = {a^{n}b^{n}c^{m}  n, m > 0} L2 = {a^{n}b^{m}c^{m}  n, m > 0}Which one of the following statements is FALSE?
L1 ∩ L2 is a contextfree language  
L1 U L2 is a contextfree language  
L1 and L2 are contextfree language  
L1 ∩ L2 is a context sensitive language 
Discuss it
Question 56 
L1' > Complement of L1 L2' > Complement of L2
L1' is recursive and L2' is recursively enumerable  
L1' is recursive and L2' is not recursively enumerable  
L1' and L2' are recursively enumerable  
L1' is recursively enumerable and L2' is recursive 
Discuss it
Question 57 
L1 = {ww^{R} w ∈ {0, 1}*} L2 = {w#w^{R}  w ∈ {0, 1}*}, where # is a special symbol L3 = {ww  w ∈ (0, 1}*)Which one of the following is TRUE?
L1 is a deterministic CFL  
L2 is a deterministic CFL  
L3 is a CFL, but not a deterministic CFL  
L3 is a deterministic CFL 
Discuss it
Question 58 
α : Given G(V, E), does G have an independent set of size  V   4? β : Given G(V, E), does G have an independent set of size 5?Which one of the following is TRUE?
α is in P and β is NPcomplete  
α is NPcomplete and β is in P  
Both α and β are NPcomplete  
Both α and β are in P 
Discuss it
Question 59 
E → E + n  E × n  nFor a sentence n + n × n, the handles in the rightsentential form of the reduction are
n, E + n and E + n × n  
n, E + n and E + E × n  
n, n + n and n + n × n  
n, E + n and E × n 
Discuss it
E → E + n {Applying E → E + n } → E + E * n {Applying E → E * n } → E + n * n {Applying E → n } → n + n * n {Applying E → n }
Question 60 
S → (S)  aLet the number of states in SLR(1), LR(1) and LALR(1) parsers for the grammar be n1, n2 and n3 respectively. The following relationship holds good
n1 < n2 < n3  
n1 = n3 < n2  
n1 = n2 = n3  
n1 ≥ n3 ≥ n2 
Discuss it
Question 61 
int main ( ) { /* Line 1 */ int I, N; /* Line 2 */ fro (I = 0, I < N, I++); /* Line 3 */ }Identify the compiler's response about this line while creating the objectmodule
No compilation error  
Only a lexical error  
Only syntactic errors  
Both lexical and syntactic errors 
Discuss it
Question 62 
A0 Al A1' A3 A4  
A0 Al A2' A3 A4  
Al A2 A2' A3 A4  
Al A2' A3 A4 A5' 
Discuss it
Question 63 
It computes 1's complement of the input number  
It computes 2's complement of the input number  
It increments the input number  
It decrements the input number 
Discuss it
The given FSM remains unchanged till first ‘1’ . After that it takes 1’s complement of rest of the input string.
We assume the input string to be ‘110010’ . Thus, according to the FSM, output is ‘001110’ .
2’s complement of ‘110010’ = 1’s complement of ‘110010’ + 1 = 001101 + 1 = 001110 Thus, the FSM computes 2’s complement of the input string.
Hence, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 64 
A) B) C) D)
A  
B  
C  
D 
Discuss it
Q_{0} Q_{1} 0 0 1 1 0 1 1 0 0 0 . . . . . .Thus, the transition sequence will be So, D would be the correct choice. Please comment below if you find anything wrong in the above post.
Question 65 
ADD A[R0], @ BThe first operand (destination) "A [R0]" uses indexed addressing mode with R0 as the index register. The second operand (source) "@ B" uses indirect addressing mode. A and B are memory addresses residing at the second and the third words, respectively. The first word of the instruction specifies the opcode, the index register designation and the source and destination addressing modes. During execution of ADD instruction, the two operands are added and stored in the destination (first operand). The number of memory cycles needed during the execution cycle of the instruction is
3  
4  
5  
6 
Discuss it
Question 66 
1 A[1] = B[J]; a Indirect addressing 2 while [*A++]; b Indexed, addressing 3 int temp = *x; c Autoincrement
(1, c), (2, b), (3, a)  
(1, a), (2, c), (3, b)  
(1, b), (2, c), (3, a)  
(1, a), (2, b), (3, c) 
Discuss it
List 1 List 2 1) A[1] = B[J]; b) Indirect addressing Here indexing is used 2) while [*A++]; c) auto increment The memory locations are automatically incremented 3) int temp = *x; a) Indirect addressing Here temp is assigned the value of int type stored at the address contained in X
Hence (C) is correct solution. See Addressing Modes for more information.
Question 67 
10, 17  
10, 22  
15, 17  
5, 17 
Discuss it
Question 68 
IF — Instruction fetch from instruction memory, RD — Instruction decode and register read, EX — Execute: ALU operation for data and address computation, MA — Data memory access  for write access, the register read at RD stage is used, WB — Register write back. Consider the following sequence of instructions: I1 : L R0, 1oc1; R0 <= M[1oc1] I2 : A R0, R0; R0 <= R0 + R0 I3 : S R2, R0; R2 <= R2  R0 Let each stage take one clock cycle.What is the number of clock cycles taken to complete the above sequence of instructions starting from the fetch of I1 ?
8  
10  
12  
15 
Discuss it
Question 69 
15  
25  
35  
45 
Discuss it
In programmed I/O, CPU does continuous polling, To transfer 10KB CPU polls for 1 sec = 10^6 microsec of processing In interrupt mode CPU is interrupted on completion of i\o , To transfer 10 KB CPU does 4 microsec of processing. Gain = 10^6 / 4 = 25000 250000 for 10000 bytes and 25 for 1 bytes.
Question 70 
10  
25  
40  
50 
Discuss it
Question 71 
A  
B  
C  
D 
Discuss it
Question 72 
if (fork() == 0) { a = a + 5; printf(“%d,%d\n”, a, &a); } else { a = a –5; printf(“%d, %d\n”, a, &a); }Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?
u = x + 10 and v = y  
u = x + 10 and v != y  
u + 10 = x and v = y  
u + 10 = x and v != y 
Discuss it
Question 73 
4  
6  
7  
9 
Discuss it
If we use 4 bytes as packet size, there will be 24 packets Total Transmission time = Time taken by first packet + Time taken by remaining packets = 3*4*t + 23*4*t = 104t If we use 6 bytes as packet size, there will be 8 packets Total Transmission time = 3*6*t + 7*6*t = 60t If we use 7 bytes as packet size, there will be 6 packets Total Transmission time = 3*7*t + 5*7*t = 56t If we use 9 bytes as packet size, there will be 4 packets Total Transmission time = 3*9*t + 3*9*t = 54tSource: question 2 of http://www.geeksforgeeks.org/computernetworksset6/ Related Articles: Circuit Switching Vs Packet Switching
Question 74 
94  
416  
464  
512 
Discuss it
Question 75 
2  
3  
4  
5 
Discuss it
a1 a2  1 3 2 4 3 4Relation E2( b1 is the key, a1 is the foreign key, hence R1(onemany) relationship set satisfy here )
b1 b2 a1  7 4 2 8 7 2 9 7 3Relation R2 ( {a1, b1} combined is the key here , representing manymany relationship R2 )
a1 b1  1 7 1 8 2 9 3 9Hence we will have minimum of 3 tables.
Question 76 
A C  2 4 3 4 4 3 5 2 7 2 9 5 6 4The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
(3,4) and (6,4)  
(5,2) and (7,2)  
(5,2), (7,2) and (9,5)  
(3,4), (4,3) and (6,4) 
Discuss it
Question 77 
select title from book as B where (select count(*) from book as T where T.price > B.price) < 5
Titles of the four most expensive books  
Title of the fifth most inexpensive book  
Title of the fifth most expensive bookTitles of the five most expensive books  
Titles of the five most expensive books 
Discuss it
Question 78 
AE, BE  
AE, BE, DE  
AEH, BEH, BCH  
AEH, BEH, DEH 
Discuss it
Question 79 
2  
3  
4  
5 
Discuss it
Question 80 
Rn < = PC + 1; PC < = M[PC];The minimum number of CPU clock cycles needed during the execution cycle of this instruction is:
2  
3  
4  
5 
Discuss it
Question 81 
double foo (int n) { int i; double sum; if (n = = 0) return 1.0; else { sum = 0.0; for (i = 0; i < n; i++) sum += foo (i); return sum; } }The space complexity of the above function is:
O(1)  
O(n)  
O(n!)  
O(n^{n}) 
Discuss it
Question 82 
double foo (int n) { int i; double sum; if (n = = 0) return 1.0; else { sum = 0.0; for (i = 0; i < n; i++) sum += foo (i); return sum; } }Suppose we modify the above function foo() and store the values of foo (i), 0 < = i < n, as and when they are computed. With this modification, the time complexity for function foo() is significantly reduced. The space complexity of the modified function would be:
O(1)  
O(n)  
O(n!)  
O(n^{n}) 
Discuss it
Question 83 
the minimum weighted spanning tree of G  
the weighted shortest path from s to t  
each path from s to t  
the weighted longest path from s to t 
Discuss it
Question 84 
a path from s to t in the minimum weighted spanning tree  
a weighted shortest path from s to t  
an Euler walk from s to t  
a Hamiltonian path from s to t 
Discuss it
Question 85 
E → number E.val = number. val  E '+' E E(1).val = E(2).val + E(3).val  E '×' E E(1).val = E(2).val × E(3).valThe above grammar and the semantic rules are fed to a yacc tool (which is an LALR (1) parser generator) for parsing and evaluating arithmetic expressions. Which one of the following is true about the action of yacc for the given grammar?
It detects recursion and eliminates recursion  
It detects reducereduce conflict, and resolves  
It detects shiftreduce conflict, and resolves the conflict in favor of a shift over a reduce action  
It detects shiftreduce conflict, and resolves the conflict in favor of a reduce over a shift action 
Discuss it
Question 86 
E → number E.val = number. val  E '+' E E(1).val = E(2).val + E(3).val  E '×' E E(1).val = E(2).val × E(3).valAssume the conflicts in Part (a) of this question are resolved and an LALR(1) parser is generated for parsing arithmetic expressions as per the given grammar. Consider an expression 3 × 2 + 1. What precedence and associativity properties does the generated parser realize?
Equal precedence and left associativity; expression is evaluated to 7  
Equal precedence and right associativity; expression is evaluated to 9  
Precedence of '×' is higher than that of '+', and both operators are left associative; expression is evaluated to 7  
Precedence of '+' is higher than that of '×', and both operators are left associative; expression is evaluated to 9 
Discuss it
Question 87 
Task T1 T2 T3 T4 T5 T6 T7 T8 T9 Profit 15 20 30 18 18 10 23 16 25 Deadline 7 2 5 3 4 5 2 7 3Are all tasks completed in the schedule that gives maximum profit?
All tasks are completed  
T1 and T6 are left out  
T1 and T8 are left out  
T4 and T6 are left out 
Discuss it
Task T1 T2 T3 T4 T5 T6 T7 T8 T9 Profit 15 20 30 18 18 10 23 16 25 Deadline 7 2 5 3 4 5 2 7 3To maximize profit, we can finish tasks in following order T7, T2, T9, T5, T3, T8, T1
Question 88 
Task T1 T2 T3 T4 T5 T6 T7 T8 T9 Profit 15 20 30 18 18 10 23 16 25 Deadline 7 2 5 3 4 5 2 7 3What is the maximum profit earned?
147  
165  
167  
175 
Discuss it
Task T1 T2 T3 T4 T5 T6 T7 T8 T9 Profit 15 20 30 18 18 10 23 16 25 Deadline 7 2 5 3 4 5 2 7 3To maximize profit, we can finish tasks in following order T7, T2, T9, T5, T3, T8, T1. We get the maximum profit as 23 + 20 + 25 + 18 + 30 + 16 + 15 = 147
Question 89 
0D 24  
0D 4D  
4D 0D  
4D 3D 
Discuss it
Question 90 
0A 20  
11 34  
4D D0  
4A E8 
Discuss it