GATE CS 1997


Question 1
The probability that it will rain today is 0.5. The probability that it will rain tomorrow is 0.6. The probability that it will rain either today or tomorrow is 0.7. What is the probability that it will rain today and tomorrow?
A
0.3
B
0.25
C
0.35
D
0.4
Probability    GATE CS 1997    
Discuss it


Question 2
The Newton-Raphson method is used to find the root of the equation x- 2 = 0. If the iterations are started from -1, the iterations will a. converge to -1 b. converge to √2 c. converge to -√2 d. not converge
A
a
B
b
C
c
D
d
Numerical Methods and Calculus    GATE CS 1997    
Discuss it


Question 3
The determinant of the matrix is determinant            
A
11
B
-48
C
0
D
-24
Linear Algebra    GATE CS 1997    
Discuss it


Question 3 Explanation: 
The determinant value of a upper or lower triangular matrix is the product of the elements in the principal diagnol. This can be easily proved by expanding along the first row or the first column depending on whether the matrix is lower triangular or upper triangular. Determinant value = 6 * 2 * 4 * -1 = -48 Therefore option (B) is correct. This explanation is provided by Chirag Manwani.
Question 4
The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list should be used?
A
singly linked list
B
doubly linked list
C
circular doubly linked list
D
array implementation of lists
Linked List    GATE CS 1997    
Discuss it


Question 4 Explanation: 
Singly linked list cannot be answer because we cannot find last element of a singly linked list in O(1) time. Doubly linked list cannot also not be answer because of the same reason as singly linked list.
Question 5
The correct matching for the following pairs is
(A) All pairs shortest path          (1) Greedy
(B) Quick Sort                       (2) Depth-First search
(C) Minimum weight spanning tree     (3) Dynamic Programming
(D) Connected Components             (4) Divide and and Conquer
Codes:
     A    B    C    D 
a    2    4    1    3
b    3    4    1    2
c    3    4    2    1
d    4    1    2    3
A
a
B
b
C
c
D
d
Analysis of Algorithms    GATE CS 1997    
Discuss it


Question 6
In the following grammar
X :: = X ⊕ Y / Y
Y :: = Z * Y / Z
Z :: = id
Which of the following is true? a. '⊕' is left associative while '*' is right associative b. Both '⊕' and '*' are left associative c. '⊕' is right associative while '*' is left associative d. None of the above
A
a
B
b
C
c
D
d
Parsing and Syntax directed translation    GATE CS 1997    
Discuss it


Question 7
Which of the following is essential for converting an infix expression to the postfix from efficiently?
A
An operator stack
B
An operand stack
C
An operand stack and an operator stack
D
A parse tree
Parsing and Syntax directed translation    GATE CS 1997    
Discuss it


Question 8
A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which of the following is true?
A
A compiler using static memory allocation can be written for L
B
A compiler cannot be written for L, an interpreter must be used
C
A compiler using dynamic memory allocation can be written for L
D
None of the above
Code Generation and Optimization    GATE CS 1997    
Discuss it


Question 9
The condition expansion facility of macro processors is provided to
A
test a condition during the execution of the expanded program
B
to expand certain model statements depending upon the value of a condition during the execution of the expanded program
C
to implement recursion
D
to expand certain model statements depending upon the value of a condition during the process of macros expansion
Code Generation and Optimization    GATE CS 1997    
Discuss it


Question 10
Heap allocation is required for languages
A
that support recursion
B
that support dynamic data structures
C
that use dynamic scope rules
D
none of the above
C Misc    GATE CS 1997    
Discuss it


There are 75 questions to complete.


My Personal Notes arrow_drop_up


Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.