## GATE CS 2010

Question 1 |

|S| = 2|T| | |

|S| = |T|-1 | |

|S| = |T| | |

|S| = |T|+1 |

**GATE CS 2010**

**Graph Theory**

**Discuss it**

a / | \ b c dNow the questions is, if sum of degrees in trees are same, then what is the relationship between number of vertices present in both trees? The answer is, ξ(G) and ξ(T) is same for two trees, then the trees have same number of vertices. It can be proved by induction. Let it be true for n vertices. If we add a vertex, then the new vertex (if it is not the first node) increases degree by 2, it doesn't matter where we add it. For example, try to add a new vertex say 'e' at different places in above example tee.

Question 2 |

^{2}-13=0 with 3.5 as the initial value. The approximation after one iteration is

3.575 | |

3.676 | |

3.667 | |

3.607 |

**GATE CS 2010**

**Numerical Methods and Calculus**

**Discuss it**

f(x) = x^{2}-13 f'(x) = 2x Applying the above formula, we get Next x = 3.5 - (3.5*3.5 - 13)/2*3.5 Next x = 3.607

Question 3 |

2 ^{10} | |

2 ^{15} | |

2 ^{20} | |

2 ^{25} |

**GATE CS 2010**

**Combinatorics**

**Discuss it**

Question 4 |

^{2}are cube roots of unity. If * denotes the multiplication operation, the structure (S, *) forms

A group | |

A ring | |

An integral domain | |

A field |

**GATE CS 2010**

**Set Theory & Algebra**

**Discuss it**

Question 5 |

_{n->∞}(1-1/n)

^{2n}?

0 | |

e ^{-2} | |

e ^{-1/2} | |

1 |

**GATE CS 2010**

**Numerical Methods and Calculus**

**Discuss it**

_{n-> ∞}( 1-1/n)

^{2n }= (Lim

_{n-> ∞}(1-1/n)

^{n})

^{2}= e

^{-2}

Question 6 |

m2 + m4 + m6 + m7 | |

m0 + m1 + m3 + m5 | |

m0 + m1 + m6 + m7 | |

m2 + m3 + m4 + m5 |

**GATE CS 2010**

**Digital Logic & Number representation**

**Discuss it**

Question 7 |

100*2 ^{10} nanoseconds | |

100*2 ^{20} nanoseconds | |

3200*2 ^{20} nanoseconds |

**GATE CS 2010**

**Computer Organization and Architecture**

**Discuss it**

Number of chips required for 4MB MM = (4 * 2^20 * 8) / (1 * 2^20) = 32 Time required to refresh one chip = 2^20 * 100 ns. Hence, time required to refresh MM = 32 * 2^20 * 100 ns = 3200 * 2^20 ns

Question 8 |

_{16}.The 2's complement representation of 8*P

(C3D8) _{16} | |

(187B) _{16} | |

(F878) _{16} | |

(987B) _{16} |

**GATE CS 2010**

**Number Representation**

**Discuss it**

_{16}is -1111 1000 0111 1011 in bianry Note that most significant bit in the binary representation is 1, which implies that the number is negative. To get the value of the number perform the 2's complement of the number. We get P as -1925 and 8P as -15400 Since 8P is also negative, we need to find 2's complement of it (-15400) Binary of 15400 = 0011 1100 0010 1000 2's Complement = 1100 0011 1101 1000 = (C3D8)

_{16}

Question 9 |

(P(XOR)Q(XOR)R)' | |

P(XOR)Q(XOR)R | |

(P+Q+R)' | |

P+Q+R |

**GATE CS 2010**

**Digital Logic & Number representation**

**Discuss it**

Q | P | R | R’ | R’ | R | F |

0 | 0 | X | X | X | 1 | 1 |

0 | 1 | X | X | 1 | X | 1 |

1 | 0 | X | 1 | X | X | 1 |

1 | 1 | 1 | X | X | X | 1 |

Question 10 |

#include void f(int *p, int *q) { p = q; *p = 2; } int i = 0, j = 1; int main() { f(&i, &j); printf("%d %d \n", i, j); getchar(); return 0; }

2 2 | |

2 1 | |

0 1 | |

0 2 |

**Pointer Basics**

**GATE CS 2010**

**Discuss it**

/* p points to i and q points to j */ void f(int *p, int *q) { p = q; /* p also points to j now */ *p = 2; /* Value of j is changed to 2 now */ }

Question 11 |

^{2}time units and package B requires 10nlog10n time units to process n records.What is the smallest value of k for which package B will be preferred over A?

12 | |

10 | |

6 | |

5 |

**GATE CS 2010**

**Numerical Methods and Calculus**

**Discuss it**

0.0001 n^{2}< 10 n log_{10}n 10^{-5}n < log_{10}n

Question 12 |

0 | |

1 | |

(n-1)/2 | |

n-1 |

**Binary Trees**

**GATE CS 2010**

**Discuss it**

a / \ b c a / \ b c / \ d eSuch a binary tree is full binary tree (a binary tree where every node has 0 or 2 children).

Question 13 |

Abstract syntax tree | |

Symbol table | |

Semantic stack | |

Parse Table |

**Misc**

**GATE CS 2010**

**Discuss it**

Question 14 |

Those that support recursion | |

Those that use dynamic scoping | |

Those that allow dynamic data structures | |

Those that use global variables |

**GATE CS 2010**

**Principles of Programming Languages**

**Discuss it**

Question 15 |

It can be used to prioritize packets | |

It can be used to reduce delays | |

It can be used to optimize throughput | |

It can be used to prevent packet looping |

**GATE CS 2010**

**Network Layer**

**Discuss it**

Question 16 |

Internet chat | |

Web browsing | |

E-mail | |

ping |

**GATE CS 2010**

**Misc Topics in Computer Networks**

**Discuss it**

Question 17 |

A | |

B | |

C | |

D |

**GATE CS 2010**

**Recursively enumerable sets and Turing machines**

**Discuss it**

A) Always True (Recursively enumerable - Recursive ) is Recursively enumerable B) Not always true L1 - L3 = L1 intersection ( Complement L3 ) L1 is recursive , L3 is recursively enumerable but not recursive Recursively enumerable languages are NOT closed under complement. C) and D) Always true Recursively enumerable languages are closed under intersection and union.

Question 18 |

1 | |

2 | |

3 | |

4 |

**GATE CS 2010**

**File structures (sequential files, indexing, B and B+ trees)**

**Discuss it**

**Anil Saikrishna Devarasetty**

**Another one:**Since the maximum number of keys is 5, maximum number of children a node can have is 6. By definition of B Tree, minimum children that a node can have would be 6/2 = 3. Therefore, minimum number of keys that a node can have becomes 2 (3-1).

Question 19 |

What pids are returned by the following SQL query for the above instance of the tables?Table: Passengerpid pname age ----------------- 0 Sachin 65 1 Rahul 66 2 Sourav 67 3 Anil 69Table : Reservationpid class tid --------------- 0 AC 8200 1 AC 8201 2 SC 8201 5 AC 8203 1 SC 8204 3 AC 8202

SLECT pid FROM Reservation , WHERE class ‘AC’ AND EXISTS (SELECT * FROM Passenger WHERE age > 65 AND Passenger. pid = Reservation.pid)

1, 0 | |

1, 2 | |

1, 3 | |

1, 5 |

**GATE CS 2010**

**SQL**

**Discuss it**

Question 20 |

I only | |

II only | |

Both I and II | |

Neither I nor II |

**GATE CS 2010**

**Transactions and concurrency control**

**Discuss it**

2 Phase Locking (2PL) is a concurrency control method that guarantees serializability. The protocol utilizes locks, applied by a transaction to data, which may block (interpreted as signals to stop) other transactions from accessing the same data during the transaction’s life. 2PL may be lead to deadlocks that result from the mutual blocking of two or more transactions. See the following situation, neither T3 nor T4 can make progress.

Timestamp-based concurrency control algorithm is a non-lock concurrency control method. In Timestamp based method, deadlock cannot occur as no transaction ever waits.

Question 21 |

19 | |

21 | |

20 | |

10 |

**GATE CS 2010**

**Software Engineering**

**Discuss it**

Cyclomatic Complexity of module = Number of decision points + 1 Number of decision points in A = 10 - 1 = 9 Number of decision points in B = 10 - 1 = 9 Cyclomatic Complexity of the integration = Number of decision points + 1 = (9 + 9) + 1 = 19

Question 22 |

P. Requirements Capture 1.Module Development and Integration Q. Design 2.Domain Analysis R. Implementation 3.Structural and Behavioral Modeling S. Maintenance 4.Performance Tuning

P-3, Q-2, R-4, S-1 | |

P-2, Q-3, R-1, S-4 | |

P-3, Q-2, R-1, S-4 | |

P-2, Q-3, R-4, S-1 |

**GATE CS 2010**

**Software Engineering**

**Discuss it**

Question 23 |

Method Used by P1 while (S1 == S2) ; Critica1 Section S1 = S2; Method Used by P2 while (S1 != S2) ; Critica1 Section S2 = not (S1);Which one of the following statements describes the properties achieved?

Mutual exclusion but not progress | |

Progress but not mutual exclusion | |

Neither mutual exclusion nor progress | |

Both mutual exclusion and progress |

**Process Management**

**GATE CS 2010**

**Discuss it**

**Mutual Exclusion:**A way of making sure that if one process is using a shared modifiable data, the other processes will be excluded from doing the same thing. while one process executes the shared variable, all other processes desiring to do so at the same time moment should be kept waiting; when that process has finished executing the shared variable, one of the processes waiting; while that process has finished executing the shared variable, one of the processes waiting to do so should be allowed to proceed. In this fashion, each process executing the shared data (variables) excludes all others from doing so simultaneously. This is called Mutual Exclusion.

**Progress Requirement:**If no process is executing in its critical section and there exist some processes that wish to enter their critical section, then the selection of the processes that will enter the critical section next cannot be postponed indefinitely.

**Solution:**It can be easily observed that the Mutual Exclusion requirement is satisfied by the above solution, P1 can enter critical section only if S1 is not equal to S2, and P2 can enter critical section only if S1 is equal to S2. But here Progress Requirement is not satisfied. Suppose when s1=1 and s2=0 and process p1 is not interested to enter into critical section but p2 want to enter critical section. P2 is not able to enter critical section in this as only when p1 finishes execution, then only p2 can enter (then only s1 = s2 condition be satisfied). Progress will not be satisfied when any process which is not interested to enter into the critical section will not allow other interested process to enter into the critical section. Reference : http://www.personal.kent.edu/~rmuhamma/OpSystems/Myos/mutualExclu.htm See http://www.geeksforgeeks.org/operating-systems-set-7/ This solution is contributed by

**Nitika Bansal**

Question 24 |

196 | |

192 | |

197 | |

195 |

**Memory Management**

**GATE CS 2010**

**Discuss it**

Question 25 |

I. Shortest remaining time first scheduling may cause starvation II. Preemptive scheduling may cause starvation III. Round robin is better than FCFS in terms of response time

I only | |

I and III only | |

II and III only | |

I, II and III |

**GATE CS 2010**

**CPU Scheduling**

**Discuss it**

**Nitika Bansal**

Question 26 |

pq + (1 - p)(1 - q) | |

(1 - q) p | |

(1 - p) q | |

pq |

**GATE CS 2010**

**Probability**

**Discuss it**

A computer can be declared faulty in two cases 1) It is actually faulty and correctly declared so (p*q) 2) Not faulty and incorrectly declared (1-p)*(1-q).

Question 27 |

^{99}is a multiple of 10

^{96}?

1/625 | |

4/625 | |

12/625 | |

16/625 |

**GATE CS 2010**

**Probability**

**Discuss it**

^{96}which are also divisor of 10

^{99}10

^{96}, 2x10

^{96}, 4x10

^{96}, 5x10

^{96}, 8x10

^{96}, 10x10

^{96}, 20x10

^{96}, 25x10

^{96}, 40x10

^{96}, 50x10

^{96}, 10x10

^{96}, 125x10

^{96}, 200x10

^{96}, 250x10

^{96}, 500x10

^{96}, 1000x10

^{96}The total number of divisors of 10

^{99 }= 10000 (See http://www.math.cmu.edu/~mlavrov/arml/13-14/number-theory-09-29-13.pdf) So the probability = 16/10000=1/625

Question 28 |

I. 7, 6, 5, 4, 4, 3, 2, 1 II. 6, 6, 6, 6, 3, 3, 2, 2 III. 7, 6, 6, 4, 4, 3, 2, 2 IV. 8, 7, 7, 6, 4, 2, 1, 1

I and II | |

III and IV | |

IV only | |

II and IV |

**GATE CS 2010**

**Graph Theory**

**Discuss it**

**Vineet Purswani.**

**Another one:**A degree sequence d1,d2,d2. . . dn of non negative integer is graphical if it is a degree sequence of a graph. We now introduce a powerful tool to determine whether a particular sequence is graphical due to Havel and Hakimi

**Havel–Hakimi Theorem :**→ According to this theorem, Let D be sequence the d1,d2,d2. . . dn with d1 ≥ d2 ≥ d2 ≥ . . . dn for n≥ 2 and di ≥ 0. → Then D0 be the sequence obtained by: → Discarding d1, and → Subtracting 1 from each of the next d1 entries of D. → That is Degree sequence D0 would be : d2-1, d2-1, d3-1 . . . , dd1+1 -1 . . . , dn → Then, D is graphical if and only if D0 is graphical. Now, we apply this theorem to given sequences: option I) 7,6,5,4,4,3,2,1 → 5,4,3,3,2,1,0 → 3,2,2,1,0,0 → 1,1,0,0,0 → 0,0,0,0 so its graphical. Option II) 6,6,6,6,3,3,2,2 → 5,5,5,2,2,1,2 ( arrange in ascending order) → 5,5,5,2,2,2,1 → 4,4,1,1,1,0 → 3,0,0,0,0 → 2,-1,-1,-1,0 but d (degree of a vertex) is non negative so its not a graphical. Option III) 7,6,6,4,4,3,2,2 → 5,5,3,3,2,1,1 → 4,2,2,1,1,0 → 1,1,0,0,0 → 0,0,0,0 so its graphical. Option IV) 8,7,7,6,4,2,1,1 , here degree of a vertex is 8 and total number of vertices are 8 , so it’s impossible, hence it’s not graphical. Hence only option I) and III) are graphic sequence and answer is option-D This solution is contributed by

**Nirmal Bharadwaj.**

Question 30 |

Everyone can fool some person at some time | |

No one can fool everyone all the time | |

Everyone cannot fool some person all the time | |

No one can fool some person at some time |

**GATE CS 2010**

**Propositional and First Order Logic.**

**Discuss it**

Question 31 |

(Q+R)' | |

(P+Q)' | |

(P+R) | |

(P+Q+R)' |

**GATE CS 2010**

**Digital Logic & Number representation**

**Discuss it**

In the 1st column there are 4 NOR Gates, number them as 1 to 4 ( top to down). In the 2nd column there are 2 NOR Gates, number them as 5 and 6 ( top to down). In the 3rd column there is only 1 NOR Gate, number it as 7. 1st numbered Gate gives output as : ( P + Q )' 2nd numbered Gate gives output as : ( Q + R )' 3rd numbered Gate gives output as : ( P + R )' 4th numbered Gate gives output as : ( R + Q )' 5th numbered Gate gives output as : (( P + Q )' + ( Q + R )')' = ((P + Q)'' . ( Q + R )'') ( De Morgan's law) = (P + Q ) . ( Q + R ) ( Idempotent Law, A'' = A) = (PQ + PR + Q + QR ) = (Q(1 + P + R) + PR) = Q + PR ( as, 1 + " any boolean expression" = 1 ) Similarly 6th numbered Gate gives output as : R + PQ (as this time R is common here) Now 7th numbered Gate gives output as : ((Q + PR) + (R + PQ))' = (Q( 1+P) + R(1+P))' = (Q+R)'

Question 32 |

11, 10, 01, 00 | |

10, 11, 01, 00 | |

10, 00, 01, 11 | |

11, 10, 00, 01 |

**GATE CS 2010**

**Digital Logic & Number representation**

**Discuss it**

t | q |

0 | q |

1 | q’ |

Question 33 |

Instruction Meaning of instruction I0 :MUL R2 ,R0 ,R1 R2 ¬ R0 *R1 I1 :DIV R5 ,R3 ,R4 R5 ¬ R3/R4 I2 :ADD R2 ,R5 ,R2 R2 ¬ R5+R2 I3 :SUB R5 ,R2 ,R6 R5 ¬ R2-R6

13 | |

15 | |

17 | |

19 |

**GATE CS 2010**

**Computer Organization and Architecture**

**Discuss it**

Question 34 |

_{0}, a

_{1}, ..., a

_{n-1 }of real numbers is defined as a

_{0}+a

_{1}/2+...+ a

_{a-1}/2

^{n-1}. A subsequence of a sequence is obtained by deleting some elements from the sequence, keeping the order of the remaining elements the same. Let X denote the maximum possible weight of a subsequence of a

_{0}, a

_{1}, ...,a

_{n-1}and Y the maximum possible weight of a subsequence of a

_{1}, a

_{2}, ...,a

_{n-1}. Then X is equal to

max(Y, a0+Y) | |

max(Y, a0+Y/2) | |

max(Y, a0+2Y) | |

a0+Y/2 |

**GATE CS 2010**

**General Aptitude**

**Discuss it**

**1.**Do not include a0 in the subsequence: then the maximum possible weight will be equal to maximum possible weight of a subsequence of {a1, a2,....an} which is represented by Y

**2.**Include a0: then maximum possible weight will be equal to a0 + (each number picked in Y will get divided by 2) <=> a0 + Y/2. Here you can note that Y will itself pick optimal subsequence to maximize the weight. Final answer will be Max(Case1, Case2) i.e. Max(Y, a0 + Y/2). Hence B).

Question 35 |

#include<stdio.h> int f(int *a, int n) { if(n <= 0) return 0; else if(*a % 2 == 0) return *a + f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = {12, 7, 13, 4, 11, 6}; printf("%d", f(a, 6)); getchar(); return 0; }

-9 | |

5 | |

15 | |

19 |

**Recursion**

**GATE CS 2010**

**Discuss it**

f(add(12), 6) /*Since 12 is first element. a contains address of 12 */ | | 12 + f(add(7), 5) /* Since 7 is the next element, a+1 contains address of 7 */ | | 7 - f(add(13), 4) | | 13 - f(add(4), 3) | | 4 + f(add(11), 2) | | 11 - f(add(6), 1) | | 6 + 0So, the final returned value is 12 + (7 – (13 – (4 + (11 – (6 + 0))))) = 15

Question 36 |

typedef struct node { int value; struct node *next; }Node; Node *move_to_front(Node *head) { Node *p, *q; if ((head == NULL: || (head->next == NULL)) return head; q = NULL; p = head; while (p-> next !=NULL) { q = p; p = p->next; } _______________________________ return head; }Choose the correct alternative to replace the blank line.

q = NULL; p->next = head; head = p; | |

q->next = NULL; head = p; p->next = head; | |

head = p; p->next = q; q->next = NULL; | |

q->next = NULL; p->next = head; head = p; |

**GATE CS 2010**

**Discuss it**

Question 37 |

a = 1 b = 10 c = 20 d = a+b e = c+d f = c+e b = c+e e = b+f d = 5+e return d+fAssuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling?

2 | |

3 | |

4 | |

6 |

**GATE CS 2010**

**Computer Organization and Architecture**

**Discuss it**

**Principle of Register Allocation**: If a variable needs to be allocated to a register, the system checks for any free register available, if it finds one, it allocates. If there is no free register, then it checks for a register that contains a dead variable ( a variable whose value is not going to be used in future ), and if it finds one then it allocates. Otherwise it goes for Spilling ( it checks for a register whose value is needed after the longest time, saves its value into the memory, and then use that register for current allocation, later when the old value of the register is needed, the system gets it from the memory where it was saved and allocate it in any register which is available ). But here we should not apply spilling as directed in the question. Let's allocate the registers for the variables. a = 1 ( let's say register R1 is allocated for variable 'a' ) b = 10 ( R2 for 'b' , because value of 'a' is going to be used in the future, hence can not replace variable of 'a' by that of 'b' in R1) c = 20 ( R3 for 'c', because values of 'a' and 'b' are going to be used in the future, hence can not replace variable 'a' or 'b' by 'c' in R1 or R2 respectively) d = a+b ( now, 'd' can be assigned to R1 because R1 contains dead variable which is 'a' and it is so called because it is not going to be used in future, i.e. no subsequent expression uses the value of variable 'a') e = c+d ( 'e' can be assigned to R1, because currently R1 contains value of varibale 'd' which is not going to be used in the subsequent expression.)

**Note**: an already calculated value of a variable is used only by READ operation ( not WRITE), hence we have to see only on the RHS side of the subsequent expressions that whether the variable is going to be used or not. f = c+e ( ' f ' can be assigned to R2, because vaule of 'b' in register R2 is not going to be used in subsequent expressions, hence R2 can be used to allocate for ' f ' replacing 'b' ) b = c+e ( ' b ' can be assigned to R3, because value of 'c' in R3 is not being used later ) e = b+f ( here 'e' is already in R1, so no allocation here, direct assignment ) d = 5+e ( 'd' can be assigned to either R1 or R3, because values in both are not used further, let's assign in R1 ) return d+f ( no allocation here, simply contents of registers R1 and R2 are added and returned) hence we need only 3 registers, R1 R2 and R3.

Question 38 |

LL(1) but not LR(1) | |

LR(1)but not LR(1) | |

Both LL(1)and LR(1) | |

Neither LL(1)nor LR(1) |

**GATE CS 2010**

**Parsing and Syntax directed translation**

**Discuss it**

First(aSa) = a First(bS) = b First(c) = c All are mutually disjoint i.e no common terminal between them, the given grammar is LL(1). As the grammar is LL(1) so it will also be LR(1) as LR parsers are more powerful then LL(1) parsers. and all LL(1) grammar are also LR(1) So option C is correct.Below are more details. A grammar is LL(1) if it is possible to choose the next production by looking at only the next token in the input string.

Formally, grammar G is LL(1) if and only if For all productions A → α1 | α2 | ... | αn, First(αi) ∩ First(αj) = ∅, 1 ≤ i,j ≤ n, i ≠ j. For every non-terminal A such that First(A) contains ε, First(A) ∩ Follow(A) = ∅Source: https://s3-ap-southeast-1.amazonaws.com/erbuc/files/4147_870334aa-9922-4f78-9c2c-713e7a7f0d53.pdf

Question 39 |

(0*10*1)* | |

0*(10*10*)* | |

0*(10*1*)*0* | |

0*1(10*1)*10* |

**GATE CS 2010**

**Discuss it**

Question 40 |

^{i}1

^{j}| i != j}. L2 = {0

^{i}1

^{j}| i = j}. L3 = {0

^{i}1

^{j}| i = 2j+1}. L4 = {0

^{i}1

^{j}| i != 2j}.

Only L2 is context free | |

Only L2 and L3 are context free | |

Only L1 and L2 are context free | |

All are context free |

**GATE CS 2010**

**Context free languages and Push-down automata**

**Discuss it**

Question 41 |

n-1 | |

n | |

n+1 | |

2n-1 |

**GATE CS 2010**

**Regular languages and finite automata**

**Discuss it**

Question 42 |

T1->>T3->>T2 | |

T2->>T1->>T3 | |

T2->>T3->>T1 | |

T3->>T1->>T2 |

**GATE CS 2010**

**Transactions and concurrency control**

**Discuss it**

T1 can complete before T2 and T3 as there is no conflict between Write(X) of T1 and the operations in T2 and T3 which occur before Write(X) of T1 in the above diagram.

T3 should can complete before T2 as the Read(Y) of T3 doesn’t conflict with Read(Y) of T2. Similarly, Write(X) of T3 doesn’t conflict with Read(Y) and Write(Y) operations of T2.

Another way to solve this question is to create a dependency graph and topologically sort the dependency graph. After topologically sorting, we can see the sequence T1, T3, T2.

Question 43 |

B -> A A -> CThe relation R contains 200 tuples and the rel ation S contains 100 tuples. What is the maximum number of tuples possible in the natural join of R and S (R natural join S)

100 | |

200 | |

300 | |

2000 |

**GATE CS 2010**

**Discuss it**

From the given set of functional dependencies, it can be observed that B is a candidate key of R. So all 200 values of B must be unique in R. There is no functional dependency given for S. To get the maximum number of tuples in output, there can be two possibilities for S.

1) All 100 values of B in S are same and there is an entry in R that matches with this value. In this case, we get 100 tuples in output.

2) All 100 values of B in S are different and these values are present in R also. In this case also, we get 100 tuples.

Question 44 |

begin if (a== b) {S1; exit;} else if (c== d) {S2;] else {S3; exit;} S4; endThe test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given. T1 : a, b, c and d are all equal T2 : a, b, c and d are all distinct T3 : a = b and c != d T4 : a != b and c = d Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?

T1, T2, T3 | |

T2, T4 | |

T3, T4 | |

T1, T2, T4 |

**GATE CS 2010**

**Software Engineering**

**Discuss it**

T1 checks S1 T2 checks S3 T4 checks S2 and S4

Question 45 |

At least twice | |

Exactly twice | |

Exactly thrice | |

Exactly once |

**Process Management**

**GATE CS 2010**

**Discuss it**

Question 46 |

_{0},...,R

_{n-1},and k processes P

_{0},....P

_{k-1}.The implementation of the resource request logic of each process P

_{i }is as follows:

if (i % 2 == 0) { if (i < n) request RIn which one of the following situations is a deadlock possible?_{i}if (i+2 < n) request R_{i+2}} else { if (i < n) request R_{n-i}if (i+2 < n) request R_{n-i-2}}

n=40, k=26 | |

n=21, k=12 | |

n=20, k=10 | |

n=41, k=19 |

**GATE CS 2010**

**Deadlock**

**Discuss it**

Option B is answer No. of resources, n = 21 No. of processes, k = 12 Processes {P0, P1....P11} make the following Resource requests: {R0, R20, R2, R18, R4, R16, R6, R14, R8, R12, R10, R10} For example P0 will request R0 (0%2 is = 0 and 0< n=21). Similarly, P10 will request R10. P11 will request R10 as n - i = 21 - 11 = 10. As different processes are requesting the same resource, deadlock may occur.

Question 47 |

255.255.255.0 | |

255.255.255.128 | |

255.255.255.192 | |

255.255.255.224 |

**GATE CS 2010**

**IP Addressing**

**Discuss it**

Question 48 |

2 nanoseconds | |

20 nanoseconds | |

22 nanoseconds | |

88 nanoseconds |

**GATE CS 2010**

**Computer Organization and Architecture**

**Discuss it**

Question 49 |

222 nanoseconds | |

888 nanoseconds | |

902 nanoseconds | |

968 nanoseconds |

**GATE CS 2010**

**Computer Organization and Architecture**

**Discuss it**

Question 50 |

7 | |

8 | |

9 | |

10 |

**GATE CS 2010**

**Discuss it**

Question 51 |

7 | |

8 | |

9 | |

10 |

**GATE CS 2010**

**Discuss it**

Question 52 |

46, 42, 34, 52, 23, 33 | |

34, 42, 23, 52, 33, 46 | |

46, 34, 42, 23, 52, 33 | |

42, 46, 33, 23, 34, 52 |

**GATE CS 2010**

**Discuss it**

Question 53 |

10 | |

20 | |

30 | |

40 |

**GATE CS 2010**

**Discuss it**

Question 54 |

4 | |

3 | |

2 | |

1 |

**GATE CS 2010**

**Network Layer**

**Discuss it**

Question 55 |

0 | |

1 | |

2 | |

3 |

**GATE CS 2010**

**Network Layer**

**Discuss it**

Question 56 |

**His rather casual remarks on politics ___________ his lack of seriousness about the subject.**

masked | |

belied | |

betrayed | |

suppressed |

**GATE CS 2010**

**English**

**Discuss it**

Question 57 |

**Circuitous**.

cyclic | |

indirect | |

confusing | |

crooked |

**GATE CS 2010**

**English**

**Discuss it**

Question 58 |

**If we manage to ____________ our natural resources, we would leave a better planet for our children.**

uphold | |

restrain | |

cherish | |

conserve |

**GATE CS 2010**

**English**

**Discuss it**

Question 59 |

2 | |

17 | |

13 | |

3 |

**GATE CS 2010**

**General Aptitude**

**Discuss it**

Question 60 |

**Unemployed: Worker**

fallow: land | |

unaware: sleeper | |

wit: jester | |

renovated: house |

**GATE CS 2010**

**English**

**Discuss it**

Question 61 |

i. Hari's age + Gita's age > Irfan's age + Saira's age ii. The age difference between Gita and Saira is 1 year. However Gita is not the oldest and Saira is not the youngest. iii. There are no twins.In what order were they born (oldest first)?

HSIG | |

SGHI | |

IGSH | |

IHSG |

**GATE CS 2010**

**General Aptitude**

**Discuss it**

Question 62 |

Modern warfare has resulted in civil strife. | |

Chemical agents are useful in modern warfare. | |

Use of chemical agents in warfare would be undesirable | |

People in military establishments like to use chemical agents in war. |

**GATE CS 2010**

**English**

**Discuss it**

Question 63 |

534 | |

1403 | |

1623 | |

1513 |

**GATE CS 2010**

**General Aptitude**

**Discuss it**

1 137 +276 --- 3Since 7+6=13 and the given answer 435 has 5 in the one's place therefore the numbers are in base 8; Because 13 will correspond to 15 (7+8) in base 8 system. As shown: Now converting 731 and 672 in decimal 7x8^2 + 3x8^1 + 1x8^0 = 473 6x8^2 + 7x8^1 + 2x8^0 = 442 Adding 473 + 442 = 915 Converting 915 into base 8 = 1623 This explanation has been contributed by

**Kriti Kushwaha.**More questions at: number-representation

Question 64 |

20 | |

10 | |

16 | |

15 |

**GATE CS 2010**

**General Aptitude**

**Discuss it**

Question 65 |

50 | |

51 | |

52 | |

54 |

**GATE CS 2010**

**General Aptitude**

**Discuss it**