GATE-CS-2002

Question 1
The rank of the matrix GATECS2002 is :
A
4
B
2
C
1
D
0
Linear Algebra    GATE-CS-2002    
Discuss it


Question 1 Explanation: 
 

Rank of the matrix is defined as the maximum number of linearly independent vectors (or) the number of non-zero rows in its row-echelon matrix. A = | 1 1| | 0 0| Since, the matrix A is already in echelon form, Just count the number of non-zero rows to get the rank of the matrix = 1.

Please refer http://en.wikipedia.org/wiki/Rank_%28linear_algebra%29 This solution is contributed by Anil Saikrishna Devarasetty .
Question 2
The trapezoidal rule for integration give exact result when the integrand is a polynomial of degree:
A
0 but not 1
B
1 but not 0
C
0 or 1
D
2
Numerical Methods and Calculus    GATE-CS-2002    
Discuss it


Question 3
The solution to the recurrence equation T(2k) = 3 T(2k-1) + 1, T (1) = 1, is:
A
2k
B
(3k + 1 - 1)/2
C
3log2k
D
2log3k
Analysis of Algorithms (Recurrences)    GATE-CS-2002    
Discuss it


Question 3 Explanation: 
We have T (2k) = 3  T (2k-1) + 1 = 32  T (2k-2) + 1 + 3 = 33  T (2k-3) + 1 + 3 + 9 . . . (k steps of recursion (recursion depth)) = 3k  T (2k-k) + (1 + 3 + 9 + 27 + ... + 3k-1) = 3k + ( ( 3k - 1 ) / 2 ) = ( (2 * 3k) + 3k - 1 )/2 = ( (3 * 3k) - 1 ) / 2 = (3k+1 - 1) / 2 Hence, B is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 4
The minimum number of colours required to colour the vertices of a cycle with η nodes in such a way that no two adjacent nodes have the same colour is
A
2
B
3
C
4
D
n - 2⌊n/2⌋ + 2
Graph Theory    GATE-CS-2002    
Discuss it


Question 4 Explanation: 
We need 3 colors to color a odd cycle and 2 colors to color an even cycle.
Question 5
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
A
log2 n
B
n/2
C
log2n - 1
D
n
GATE-CS-2002    
Discuss it


Question 5 Explanation: 
Singly linked list has uni - directional flow, i.e., it has only one pointer for moving (the next pointer). In the worst case, for searching an element in the singly linked list, we will have to traverse the whole list (the case when the required element is either the last element or is not present in the list). So, in the worst case for a list of length n, we will have to go to each node for comparison and thus, we would be needing 'n' comparisons. Thus, D is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 6
Which of the following is true?
A
The set of all rational negative numbers forms a group under multiplication.
B
The set of all non-singular matrices forms a group under multiplication.
C
The set of all matrices forms a group under multiplication.
D
Both (2) and (3) are true.
Set Theory & Algebra    GATE-CS-2002    
Discuss it


Question 6 Explanation: 
A group is a set of elements such that any two elements of the group combine to form a third element of the same group. Also, a group must satisfy certain properties: Closure Property - Any two elements of the set when operated open by an operator form a third element that must also be in the set. Associative Property - For an expression with three or more operands having the same operator between them, the order of operation does not matter as long as the sequence of operands are not changed. For example, (a + b) + c = a + (b + c). Identity element Property - Each set must have an identity element, which is an element of the set such that when operated upon with another element of the set, it gives the element itself. For example, a + 0 = a. Here, 0 is the identity element. Invertibility Property - For each element of the set, inverse should exist.   Now, for the given statements, we have A is incorrect as it does not satisfies closure property. If we take two negative numbers and multiply them, we get a positive number which is not in the set. B is correct. The matrices in the set must be non - singular, i.e., their determinant should not be zero, for the inverse to exist (Invertibility Property). C is incorrect as the inverse of a singular (determinant = 0) matrix does not exist (Invertibility Property violated).   Thus, B is the correct option.     Please comment below if you find anything wrong in the above post.
Question 7
The language accepted by a Pushdown Automation in which the stack is limited to 10 items is best described as
A
Context Free
B
Regular
C
Deterministic Context Free
D
Recursive
Context free languages and Push-down automata    GATE-CS-2002    
Discuss it


Question 7 Explanation: 
Pushdown automata is used for context free languages, i.e., languages in which the length of elements is unrestricted and length of one element is related to other. To resolve this problem, we use a stack with no restrictions on length.
 
But in the given case, length of stack is restricted. Thus, this pushdown automata can only accept languages which can also be accepted by finite state automata and a finite state automata accepts only regular languages.
 
Thus, B is the correct choice.
 
Please comment below if you find anything wrong in the above post.
Question 8
"If X, then Y unless Z" is represented by which of the following formulae in propositional logic? ("¬" is negation "^" is conjunction, and "→" is implication)
A
(X ^ ¬ Z) → Y
B
(X ^ Y) → ¬ Z
C
(X → (Y ^ ¬ Z)
D
(X → Y(^ ¬ Z)
Propositional and First Order Logic.    GATE-CS-2002    
Discuss it


Question 8 Explanation: 
The statement "If X then Y unless Z" means, if Z doesn't occur, X implies Y i.e. ¬Z(XY), which is equivalent to Z(XY) (since PQ ≡ ¬PQ), which is then equivalent to Z(¬XY). Now we can look into options which one matches with this.
So option (a) is (X¬Z)Y = ¬((X¬Z))Y = (¬XZ)Y, which matches our expression. So option A is correct. Source: http://www.cse.iitd.ac.in/~mittal/gate/gate_math_2002.html
Question 9
A device employing INTR line for device interrupt puts the CALL instruction on the data bus while
		 
A)      gatecs2002Q8 is active
B)	HOLD is active
C)	READY is active
D)	None of these
A
A
B
B
C
C
D
D
Microprocessor    GATE-CS-2002    
Discuss it


Question 9 Explanation: 
Explanation: INTR is a signal which if enabled then microprocessor has interrupt enabled .It receives high INTR signal and activates INTA signal, So another request can’t be accepted till CPU is busy in servicing interrupt So (A) is correct option.
Question 10
In 8085, which of the following modifies the program counter ?
A
Only PCHL instruction
B
Only ADD instructions
C
Only JMP and CALL instructions
D
All instructions
Microprocessor    GATE-CS-2002    
Discuss it


Question 10 Explanation: 
Program counter is the register which has the next location of the program to be executed next. JMP & CALL changes the value of PC. PCHL instruction copies content of registers H & L to PC. ADD instruction after completion increments program counter. So program counter is modified in all cases. Hence (D) is correct option.
Question 11
In serial data transmission, every byte of data is padded with a ‘0’ in the beginning and one or two ‘I’ s at the end of byte because
A
Receiver is to be synchronized for byte reception
B
Receiver recovers lost ‘0’ and ‘1’s from these padded bits
C
Padded bits are useful in parity computation
D
None of these
Data Link Layer    GATE-CS-2002    
Discuss it


Question 11 Explanation: 
In serial communication, the sender & receiver needs to be synchronized with each other.
'0' is added in the beginning of data as start bit and '1' is added at the end as a stop bit. The start signal tells the receiver about the arrival of data and the stop signal resets the receiver's state for the arrival of a new data.
 
Thus, in serial communication receiver is to be synchronized for byte reception.
 
Please comment below if you find anything wrong in the above post.
Question 12
Minimum sum of product expression for f(w, x, y, z) shown in Karnaugh-map below is  
yz\wx 00 01 11 10
00 0 1 1 0
01 x 0 0 1
11 x 0 0 1
10 0 1 1 x
A
xz + y'z
B
xz' + zx'
C
x'y + zx'
D
None of these
Digital Logic & Number representation    GATE-CS-2002    
Discuss it


Question 12 Explanation: 
59 On solving this we get xz’+zx’ so ans is (B) part
Question 13
Which of the following is not a form of memory?
A
instruction cache
B
instruction register
C
instruction opcode
D
translation lookaside buffer
Memory Management    GATE-CS-2002    
Discuss it


Question 13 Explanation: 
Instruction Cache - Used for storing instructions that are frequently used Instruction Register - Part of CPU's control unit that stores the instruction currently being executed Instruction Opcode - It is the portion of a machine language instruction that specifies the operation to be performed Translation Lookaside Buffer - It is a memory cache that stores recent translations of virtual memory to physical addresses for faster access.   So, all the above except Instruction Opcode are memories. Thus, C is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 14
The decimal value 0.25
A
is equivalent to the binary value 0.1
B
is equivalent to the binary value 0.01
C
is equivalent to the binary value 0.00111....
D
cannot be represented precisely in binary
Number Representation    GATE-CS-2002    
Discuss it


Question 14 Explanation: 
We have 0.2510 0.25 * 2 = 0.50          0 (whole part) 0.50 * 2 = 1.00          1 (whole part)   So, 0.2510 = 0.012 Thus, B is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 15
The 2' s complement representation of the decimal value - 15 is
A
1111
B
11111
C
111111
D
10001
Number Representation    GATE-CS-2002    
Discuss it


Question 15 Explanation: 
We have -1510 = 1 11112 1's complement of  -15 = 1 0000 (Here, 1 represents negative sign) 2's complement of -15 = 1 0001   Hence, D is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 16
Sign extension is a step in
A
floating point multiplication
B
signed 16 bit integer addition
C
arithmetic left shift
D
converting a signed integer from one size to another
Number Representation    GATE-CS-2002    
Discuss it


Question 16 Explanation: 
Question 17
In the C language
A
At most one activation record exists between the current activation record and the activation record for the main
B
The number of activation records between the current activation record and the activation record for the main depends on the actual function calling sequence.
C
The visibility of global variables depends on the actual function calling sequence.
D
Recursion requires the activation record for the recursive function to be saved on a different stack before the recursive function can be called.
GATE-CS-2002    
Discuss it


Question 17 Explanation: 
  The portion of the stack used for an invocation of a function is called the function’s stack frame or activation record. An activation record is another name for Stack Frame. It's the data structure that composes a call stack. It is generally composed of:
  • Locals to the callee
  • Return address to the caller
  • Parameters of the callee
The Call Stack is thus composed of any number of activation records that get added to the stack as new subroutines are added, and removed from the stack (usually) as they return. In C language the program execution starts with main function, so it is the first activation record in the function stack. Now looking at each option-: Option a- The statement is false as any number of functions can be called from the main. It might not be necessary that at-most one activation record exist and activation record of main. For example- as in case of recursion.
Recurse (int n)
{
	if(n==0)
         return ;
       else 
         recurse(n-1);
}
In above example activation record of main and recurse(4) will have activation record of recurse(5), recurse(6) (more than one) if we pass n=6 initially to the function. Option b- True as soon as a function is called its activation record is created in the function stack. Option c- In C language variables are statically scoped not dynamically, the global variables are statically assigned address space when the execution starts not depending on when and where they are used. Option d- The functions are stored in the same each time recursive call is made, considering the above recurse function
Recurse(4)
Recurse(5)
Recurse(6)
Main()
  Refer http://geeksquiz.com/c-misc-question-1/ This solution is contributed by Parul sharma.  
Question 18
The results returned by functions under value-result and reference parameter passing conventions
A
Do not differ
B
Differ in the presence of loops
C
Differ in all cases
D
May differ in the presence of exceptions
Principles of Programming Languages    GATE-CS-2002    
Discuss it


Question 18 Explanation: 
The result is updated since the updated values are returned back to the original variable. In call by reference, any change in the variable reflects immediately. A small example for call by reference and call by value is given below. http://code.geeksforgeeks.org/F6uLti. See question 5 of http://www.geeksforgeeks.org/principle-of-programming-languages-set-1/ This solution is contributed by Anil Saikrishna Devarasetty
Question 19
Relation R with an associated set of functional dependencies, F is decomposed into BCNF. The redundancy (arising out of functional dependencies) in the resulting set relations is.
A
Zero
B
More than zero but less than that of an equivalent 3NF decomposition
C
Proportional to the size of F+
D
Indeterminate
Database Design(Normal Forms)    GATE-CS-2002    
Discuss it


Question 19 Explanation: 
If a relational schema is in BCNF then all redundancy based on functional dependency has been removed, although other types of redundancy may still exist. Source: http://en.wikipedia.org/wiki/Boyce%E2%80%93Codd_normal_form
Question 20
With regard to the expressive power of the formal relational query languages, which of the following statements is true?
A
Relational algebra is more powerful than relational calculus
B
Relational algebra has the same power as relational calculus
C
Relational algebra has the same power as safe relational calculus
D
None of the above
Database Design(Normal Forms)    GATE-CS-2002    
Discuss it


Question 20 Explanation: 

A query can be formulated in relational calculus if and only if it can be formulated in relational algebra. So, relational algebra has the same power as relational calculus.
But, it is possible to write syntactically correct relational calculus queries that have infinite number of answers. Such queries are unsafe. Queries that have an finite number of answers are safe relational calculus queries.
Thus, Relational algebra has the same power as safe relational calculus.
 
Thus, option (C) is the answer.
 
Please comment below if you find anything wrong in the above post.
Question 21
In 2' s complement addition, overflow
A
is flagged whenever there is carry from sign bit addition
B
cannot occur when a positive value is added to a negative value
C
is flagged when the carries from sign bit and previous bit match
D
none of the above
Number Representation    GATE-CS-2002    
Discuss it


Question 21 Explanation: 
is flagged when the carries from sign bit and previous bit DO NOT match. Refer http://en.wikipedia.org/wiki/Two%27s_complement#Addition
Question 22
Which of the following scheduling algorithms is non-preemptive?
A
Round Robin
B
First-In First-Out
C
Multilevel Queue Scheduling
D
Multilevel Queue Scheduling with Feedback
GATE-CS-2002    CPU Scheduling    
Discuss it


Question 22 Explanation: 
Round Robin - Preemption takes place when the time quantum expires First In First Out - No Preemption, the process once started completes before the other process takes over Multi Level Queue Scheduling - Preemption takes place when a process of higher priority arrives Multi Level Queue Scheduling with Feedback - Preemption takes a place when process of higher priority arrives or when the quantum of high priority queue expires and we need to move the process to low priority queue   So, B is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 23
The optimal page replacement algorithm will select the page that
A
Has not been used for the longest time in the past.
B
Will not be used for the longest time in the future.
C
Has been used least number of times.
D
Has been used most number of times.
Memory Management    GATE-CS-2002    
Discuss it


Question 23 Explanation: 
The optimal page replacement algorithm will select the page whose next occurrence will be after the longest time in future. For example, if we need to swap a page and there are two options from which we can swap, say one would be used after 10s and the other after 5s, then the algorithm will swap out the page that would be required 10s later. Thus, B is the correct choice.   Please comment below if you find anything wrong in the above post.
Question 24
In the absolute addressing mode
A
the operand is inside the instruction
B
the address of the operand is inside the instruction
C
the register containing address of the operand is specified inside the instruction
D
the location of the operand is implicit
Microprocessor    GATE-CS-2002    
Discuss it


Question 24 Explanation: 
(b) is the answer. Absolute addressing mode means address of operand is given in the instruction. (a) operand is inside the instruction -> immediate addressing (c) -> register addressing (d) -> implicit addressing
Question 25
Maximum number of edges in a n - node undirected graph without self loops is
A
n2
B
n(n - 1)/2
C
n - 1
D
(n + 1) (n)/2
Graph Theory    GATE-CS-2002    
Discuss it


Question 25 Explanation: 
Background required - Basic Combinatorics Since the given graph is undirected, that means the order of edges doesn't matter. Since we have to insert an edge between all possible pair of vertices, therefore problem reduces to finding the count of the number of subsets of size 2 chosen from the set of vertices. Since the set of vertices has size n, the number of such subsets is given by the binomial coefficient C(n,2) (also known as "n choose 2"). Using the formula for binomial coefficients, C(n,2) = n(n-1)/2.e This explanation has been contributed by Pranjul Ahuja.
Question 26
Consider the following logic circuit whose inputs and function and output is f.
f(dx, y, z)
f1(dx, y, z)
f2(dx, y, z)
f3(dx, y, z) = ?
GATECS2002Q26 Given that
f1(dx, y, z) = ∑(d0, 1, 3, 5),
f1(dx, y, z) = ∑(d6, 7) and
f1(dx, y, z) = ∑(d1, 4, 5),
f3 is :
A
∑(1, 4, 5)
B
∑(6, 7)
C
∑(0, 1, 3, 5)
D
None of these
Digital Logic & Number representation    GATE-CS-2002    
Discuss it


Question 26 Explanation: 
ans_60
Question 27
Consider the following multiplexor where 10, 11, 12, 13 are four data input lines selected by two address line combinations A1A0 = 00, 01, 10, 11 respectively and f is "the output of the multiplexor. EN is the enable input. GATECS200227 The function f(x, y, z) implemented by the above circuit is :
A
xyz'
B
xy + z
C
x + z
D
None of these
Digital Logic & Number representation    GATE-CS-2002    
Discuss it


Question 27 Explanation: 
F = (A1’A0’I0 + A1’A0I1 + A1A0’I2 + A1A0I3) * EN F = (XYZ' +XYZ + Y'ZY + ZY')Z' F = (XYZ' +XYZ + ZY'(Y + 1))Z' F = (XYZ' +XYZ + ZY' * 1)Z' F = (XY(Z’ + Z) + ZY’)Z’ F = (XY + ZY’)Z’ F = XYZ’ + 0 F = XYZ' Thus, option (A) is correct. Please comment below if you find anything wrong in the above post.
Question 28
Let f(A, B) = A' + B. Simplified expression for function f(f(x + y, y)z) is :
A
x' + z
B
xyz
C
xy' + z
D
None of these
Digital Logic & Number representation    GATE-CS-2002    
Discuss it


Question 28 Explanation: 

Simplified expression for given function 'g' is :
g = f( f(x + y, y), z) g = f( ((x + y)’ + y), z) g = f( (x’y’ + y), z) g = f( ((y + y’) * (x’ + y)), z) g = f( (1 * (x’ + y)), z) g = f( (x’ + y), z) g = (x’ + y)’ + z) g = xy’ + z
 
Thus, option (C) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 29
What are the states of the Auxiliary Carry (AC) and Carry Flag (dCY) after executing the following 8085 program?
   MVI L, 5DH
   MVI L, 6BH
   MOV A, H
   ADD L
A
AC = 0 and CY = 0
B
AC = 1 and CY = 1
C
AC = 1 and CY = 0
D
AC = 0 and CY = 0
Microprocessor    GATE-CS-2002    
Discuss it


Question 29 Explanation: 
  First we load  5D in L register But we have not stored it to the accumulator So, when we load 6B in L register, it overwrites 5D in L register and the same value 6BH is copied to accumulator Now A = 6BH L = 6BH ADD L i.e. A = A + L It will generate internal carry i.e. B + B = 22 i.e. 22 - 16 = 6 adding 2 to 6 + 6 => we get 14 => D Hence answer is D6 Since there is internal carry only, no final carry as 14 < 16 So, Auxillary carry flag(AC) = 1 Carry Flag(CY) = 0       This solution is contributed by Mohit Gupta .
Question 30
The Finite state machine described by the following state diagram with A as starting state, where an arc label is x / y and x stands for 1-bit input and y stands for 2- bit output GATECS2002Q28
A
Outputs the sum of the present and the previous bits of the input.
B
Outputs 01 whenever the input sequence contains 11.
C
Outputs 00 whenever the input sequence contains 10.
D
None of these
Regular languages and finite automata    GATE-CS-2002    
Discuss it


Question 30 Explanation: 

We assume the input string to be 1101.
1. (A, 1) --> (B, 01) Here, previous input bit + present input bit = 0 + 1 = 01 = output
2. (B, 1) --> (C, 10) Here, previous input bit + present input bit = 1 + 1 = 10 = output
3. (C, 0) --> (A, 01) Here, previous input bit + present input bit = 1 + 0 = 01 = output
4. (A, 1) --> (B, 01) Here, previous input bit + present input bit = 0 + 1 = 01 = output
 
Thus, option (A) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 31
The performance of a pipelined processor suffers if :
A
the pipeline stages have different delays
B
consecutive instructions are dependent on each other
C
the pipeline stages share hardware resources
D
all of the above
Computer Organization and Architecture    GATE-CS-2002    
Discuss it


Question 31 Explanation: 
Pipelining is a method to execute a program breaking it in several independent sequence of stages. In that case pipeline stages can’t have different delays ,no dependency among consecutive  instructions and sharing of hardware resources should not be there. So option (D) is correct
Question 32
Horizontal microprogramming :
A
does not require use of signal decoders
B
results in larger sized microinstructions than vertical microprogramming
C
uses one bit for each control signal
D
all of the above.
Microprocessor    GATE-CS-2002    
Discuss it


Question 32 Explanation: 
In horizontal microprogramming the instruction size is less as compared to vertical microprogramming. So, there is no need for decoding.
But, one bit is used for all control signals to execute the microinstruction. If the bit is set to ‘1’ the control signal field is activated. If the bit is set to ‘0’ the control signal field is deactivated.
 
Thus, option (D) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 33
Consider the following declaration of a two dimensional array in C:
   char a[100][100];
Assuming that the main memory is byte-addressable and that the array is stored starting from memory address 0, the address of a [40][50] is :
A
4040
B
4050
C
5040
D
5050
GATE-CS-2002    
Discuss it


Question 33 Explanation: 
Address of a[40][50] = 
     Base address + 40*100*element_size + 50*element_size
     0 + 4000*1 + 50*1
     4050
Question 34
The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is:
A
n/2
B
(n - 1)/3
C
(n - 1)/2
D
(2n + 1)/3
GATE-CS-2002    
Discuss it


Question 35
Consider the following algorithm for searching for a given number x in an unsorted array A[1.....n] having n distinct values:
   1. Choose an i uniformaly at random from 1..... n;
   2. If A[i] = x then Stop else Goto 1; 
Assuming that x is present in A, what is the expected number of comparisons made by the algorithm before it terminates ?
A
n
B
n - 1
C
2n
D
n/2
GATE-CS-2002    
Discuss it


Question 35 Explanation: 

If you remember the coin and dice questions, you can just guess the answer for the above.

Below is proof for the answer.

Let expected number of comparisons be E. Value of E is sum of following expression for all the possible cases.

number_of_comparisons_for_a_case * probability_for_the_case 

Case 1

  If A[i] is found in the first attempt 
  number of comparisons = 1
  probability of the case  = 1/n

Case 2

  If A[i] is found in the second attempt 
  number of comparisons = 2
  probability of the case  = (n-1)/n*1/n

Case 3

  If A[i] is found in the third attempt 
  number of comparisons = 2
  probability of the case  = (n-1)/n*(n-1)/n*1/n

There are actually infinite such cases. So, we have following infinite series for E.

E  = 1/n + [(n-1)/n]*[1/n]*2 + [(n-1)/n]*[(n-1)/n]*[1/n]*3 + ….  (1)

After multiplying equation (1) with (n-1)/n, we get

E (n-1)/n = [(n-1)/n]*[1/n] + [(n-1)/n]*[(n-1)/n]*[1/n]*2 + 
                                 [(n-1)/n]*[(n-1)/n]*[(n-1)/n]*[1/n]*3 ……….(2)

Subtracting (2) from (1), we get

E/n = 1/n + (n-1)/n*1/n + (n-1)/n*(n-1)/n*1/n + …………

The expression on right side is a GP with infinite elements. Let us apply the sum formula (a/(1-r))

  E/n = [1/n]/[1-(n-1)/n]  = 1
  E = n
Question 36
The running time of the following algorithm Procedure A(n)
  If n < = 2 return (1) 
  else return (A(Image not present√nImage not present));
is best described by :
A
O(n)
B
O(log n)
C
O(log Log n)
D
O(l1)
GATE-CS-2002    
Discuss it


Question 36 Explanation: 
  Now let the function is called k times parul_7 Taking log on both side (base 2). parul_8 Taking log again. parul_9 Running time complexity = number of function calls = k = Therefore Running time complexity = parul_9. See question 5 of http://www.geeksforgeeks.org/data-structures-and-algorithms-set-11/   This solution is contributed by Parul Sharma.  
Question 37
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left subtree is at least half and at most twice the number of nodes in the right subtree. The maximum possible height (number of nodes on the path from the root to the furthest leaf) of such a tree on n nodes is best described by which of the following?
A
log2 n
B
log4/3 n
C
log3 n
D
log3/2 n
GATE-CS-2002    
Discuss it


Question 37 Explanation: 
anil_ds_37 See question 3 of http://www.geeksforgeeks.org/data-structures-and-algorithms-set-13/ This solution is contributed by Anil Saikrishna Devarasetty
Question 38
The smallest finite automation which accepts the language {x | length of x is divisible by 3} has :
A
2 states
B
3 states
C
4 states
D
5 states
Regular languages and finite automata    GATE-CS-2002    
Discuss it


Question 38 Explanation: 

 
2002-38 Thus, we require 3 states.
 
So, B is the correct choice.
 
Please comment below if you find anything wrong in the above post.
Question 39
Which of the following is true?
A
The complement of a recursive language is recursive.
B
The complement of a recursively enumerable language is recursively enumerable.
C
The complement of a recursive language is either recursive or recursively enumerable.
D
The complement of a context-free language is context-free.
Recursively enumerable sets and Turing machines    GATE-CS-2002    
Discuss it


Question 40
The Newton-Raphson iteration Xn + 1 = (Xn/2) + 3/(2Xn) can be used to solve the equation
A
X2 = 3
B
X3 = 3
C
X2 = 2
D
X3 = 2
Numerical Methods and Calculus    GATE-CS-2002    
Discuss it


Question 40 Explanation: 
In Newton-Raphson's method, We use the following formula to get the next value of f(x). f'(x) is derivative of f(x). af2d6f780d8673d64e8cc328ae52631d Option (A)
X2 = 3
f(x) = X2 - 3

Xn + 1 = Xn - (Xn2 - 3) / (2*Xn)
  =  (Xn/2) + 3/(2xn) 
Question 41
Four fair coins are tossed simultaneously. The probability that at least one head and one tail turn up is :
A
1/16
B
1/8
C
7/8
D
15/16
Probability    GATE-CS-2002    
Discuss it


Question 41 Explanation: 
There are only two cases (when all head or all tail) against the given output. So the required probability is (16-2)/16 = 7/8.
Question 42
The binary relation S = ф (empty set) on set A = {1, 2, 3} is :
A
Neither reflexive nor symmetric
B
Symmetric and reflexive
C
Transitive and reflexive
D
Transitive and symmetric
Set Theory & Algebra    GATE-CS-2002    
Discuss it


Question 42 Explanation: 
  • Reflexive : A relation is reflexive if every element of set is paired with itself. Here none of the element of A is paired with themselves, so S is not reflexive.
  • Symmetric : This property says that if there is a pair (a, b) in S, then there must be a pair (b, a) in S. Since there is no pair here in S, this is trivially true, so S is symmetric.
  • Transitive : This says that if there are pairs (a, b) and (b, c) in S, then there must be pair (a,c) in S. Again, this condition is trivially true, so S is transitive. Thus, option (D) is correct. Please comment below if you find anything wrong in the above post.
Question 43
The C language is:
A
A context free language
B
A context sensitive language
C
A regular language
D
Parasble fully only by a Turing machine
GATE-CS-2002    
Discuss it


Question 43 Explanation: 
Question 44
To evaluate an expression without any embedded function calls:
A
One stack is enough
B
Two stacks are needed
C
As many stacks as the height of the expression tree are needed
D
A Turing machine is needed in the general case
Stack    GATE-CS-2002    
Discuss it


Question 44 Explanation: 

Any expression can be converted into Postfix or Prefix form.
Prefix and postfix evaluation can be done using a single stack.
For example : Expression '10 2 8 * + 3 -' is given. PUSH 10 in the stack. PUSH 2 in the stack. PUSH 8 in the stack. When operator '*' occurs, POP 2 and 8 from the stack. PUSH 2 * 8 = 16 in the stack. When operator '+' occurs, POP 16 and 10 from the stack. PUSH 10 * 16 = 26 in the stack. PUSH 3 in the stack. When operator '-' occurs, POP 26 and 3 from the stack. PUSH 26 - 3 = 23 in the stack. So, 23 is the answer obtained using single stack.
 
Thus, option (A) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 45
Dynamic linking can cause security concerns because:
A
Security is dynamic
B
The path for searching dynamic libraries is not known till runtime
C
Linking is insecure
D
Crytographic procedures are not available for dynamic linking
Memory Management    GATE-CS-2002    
Discuss it


Question 45 Explanation: 
Static Linking and Static Libraries is the result of the linker making copy of all used library functions to the executable file. Static Linking creates larger binary files, and need more space on disk and main memory. Examples of static libraries (libraries which are statically linked) are, .a files in Linux and .lib files in Windows. Dynamic linking and Dynamic Libraries Dynamic Linking doesn’t require the code to be copied, it is done by just placing name of the library in the binary file. The actual linking happens when the program is run, when both the binary file and the library are in memory. Examples of Dynamic libraries (libraries which are linked at run-time) are, .so in Linux and .dll in Windows. In Dynamic Linking,the path for searching dynamic libraries is not known till runtime    
Question 46
Which combination of the following features will suffice to characterize an OS as a multi-programmed OS?
(a) More than one program may be loaded into main memory 
   at the same time for execution. 
(b) If a program waits for certain events such as I/O, 
   another program is immediately scheduled for execution. 
(c) If the execution of program terminates, another program 
   is immediately scheduled for execution. 
A
a
B
a and b
C
a and c
D
a, b and c
GATE-CS-2002    
Discuss it


Question 46 Explanation: 
(a) More than one program may be loaded into main memory 
   at the same time for execution. 
True: Only done in a multiprogrammed OS, not in single
       programmed OS

(b) If a program waits for certain events such as I/O, 
   another program is immediately scheduled for execution.
True: Only done in a multiprogrammed OS, not in single
       programmed OS
 
(c) If the execution of program terminates, another program 
   is immediately scheduled for execution. 
False: Done in both Multiprogrammed and single
       programmed OSs
Question 47
In the index allocation scheme of blocks to a file, the maximum possible size of the file depends on :
A
the size of the blocks, and the size of the ad­dress of the blocks.
B
the number of blocks used for the index, and the size of the blocks.
C
the size of the blocks, the number of blocks used for the index, and the size of the address of the blocks.
D
None of these
File structures (sequential files, indexing, B and B+ trees)    GATE-CS-2002    
Discuss it


Question 47 Explanation: 

In the index allocation method, an index block stores the address of all the blocks allocated to a file.
When indexes are created, the maximum number of blocks given to a file depends upon the size of the index which tells how many blocks can be there and size of each block(i.e. same as depending upon the number of blocks for storing the indexes and size of each index block).
 
Thus, option (B) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 48
A B+ -tree index is to be built on the Name attribute of the relation STUDENT. Assume that all student names are of length 8 bytes, disk block are size 512 bytes, and index pointers are of size 4 bytes. Given this scenario, what would be the best choice of the degree (i.e. the number of pointers per node) of the B+ -tree?
A
16
B
42
C
43
D
44
B and B+ Trees    GATE-CS-2002    
Discuss it


Question 48 Explanation: 
Size of 1 record = 8 + 4 = 12

Let the order be N.

No. of index values per block = N - 1

(N - 1) 12 + 4 = 512

12N - 12 + 4 = 512

16N = 1009

N = 43.3333
Question 49
Relation R is decomposed using a set of functional dependencies, F and relation S is decomposed using another set of functional dependencies G. One decomposition is definitely BCNF, the other is definitely 3NF, but it is not known which is which. To make a guaranteed identification, which one of the following tests should be used on the decompositions? (Assume that the closures of F and G are available).
A
Dependency-preservation
B
Lossless-join
C
BCNF definition
D
3NF definition
Database Design(Normal Forms)    GATE-CS-2002    
Discuss it


Question 49 Explanation: 
Answer is (C) since to identify BCNF we need BCNF definition. One relation which satisfies will be in BCNF and other will be in 3NF. 1st is wrong because dependency may be preserved by both 3NF and BCNF. 2nd is wrong Because both 3NF and BCNF decomposition can be lossless. 4th is wrong because 3NF and BCNF both are in 3NF also.
Question 50
From the following instance of a relation scheme R (A, B, C), we can conclude that :
A B C
1 1 1
1 1 0
2 3 2
2 3 2
A
A functionally determines B and B function­ally determines C
B
A functionally determines B and B does not functionally determine C
C
B does not functionally determine C
D
A does not functionally determine B and B does not functionally determine C
Database Design(Normal Forms)    GATE-CS-2002    
Discuss it


Question 50 Explanation: 
Generally Normalization is done on the schema itself. From the relational instance given,we may strike out FD s that do not hold. e.g.B does not functionally determine C(This is true). But we cannot say that A functionally determines B for the entire relation itself. This is because that, A->B holds for this instance, but in future there might be some tuples added to the instance that may violate A->B. So overall on the relation we cannot conclude that A->B, from the relational instance which is just a subset of an entire relation. Refer http://geeksquiz.com/database-normalization-introduction/ for more details.
There are 50 questions to complete.

GATE CS Corner


See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.