GATE CS 1997

  • Last Updated : 11 Oct, 2021


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
GATE CS 1997    Probability    
Discuss it


Question 1 Explanation: 
Let A is the event that it will rain today and B is the event that it will rain tomorrow.
probability (A intersection B) = probability ( A ) + probability (B) - probability (A union B).
probability (A intersection B) = 0.5 + 0.6 - 0.7 = 0.4 
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
GATE CS 1997    Numerical Methods and Calculus    
Discuss it


Question 3
The determinant of the matrix is determinant            
A
11
B
-48
C
0
D
-24
GATE CS 1997    Linear Algebra    
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

GATE CS 1997    Top MCQs on Linked List Data Structure with Answers    
Discuss it


Question 4 Explanation: 
As list concatenation requires traversing at least one list to the end. So singly linked list and doubly linked list requires O(n) time complexity whereas circular doubly linked list required O(1) time.


 

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
GATE CS 1997    Top MCQs on Complexity Analysis of Algorithms with Answers    
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
GATE CS 1997    Parsing and Syntax directed translation    
Discuss it


Question 6 Explanation: 
X :: = X ⊕ Y is left recursive grammar, so ‘⊕’ is left associative and Z * Y is right recursive grammar, so ‘*’ is right associative.
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
GATE CS 1997    Parsing and Syntax directed translation    
Discuss it


Question 7 Explanation: 
Operator stack is used for converting infix to postfix expression such that operators like as +, *, (, ), / are pushed in stack where as operand stack is used for converting Postfix to Prefix evaluation such that operands are 7,2,1,2 etc. Hence, option (A) is correct.
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
GATE CS 1997    Code Generation and Optimization    
Discuss it


Question 8 Explanation: 
If a language L allows declaration of arrays whose sizes are not known during compilation time. It is required to use efficient use of memory. So a compiler using dynamic memory allocation can be written for L. An array is a collection of data items, all of the same type, accessed using a common name. C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely malloc, realloc, calloc and free.
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
GATE CS 1997    Code Generation and Optimization    
Discuss it


Question 9 Explanation: 
Macro processors provided a condition expansion facility to expand the certain module statements depending upon the value of a condition during the process of macros expansion. Hence, option (D) is correct.
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
GATE CS 1997    C Misc    
Discuss it


There are 75 questions to complete.
My Personal Notes arrow_drop_up