Dark Mode On/Off

# GATE 2020 - Programming and Data Structures Test 3

This Test will cover complete Programming and Data Structures with very important questions, starting off from basics to advanced level.
Q. If `S` is an array of 80 characters, then the value assigned to S through the statement `scanf("%s",S)` with input `12345` would be?
 A. "12345" B. Nothing since 12345 is an integer C. S is an illegal name for a string D. %s cannot be used for reading in values of S
Q. The following declaration ` enum colors{black, blue, green}; ` represents?
 A. black = -1, blue = 2, green = 3 B. black = -1, blue = -2, green = -3 C. black = -1, blue = 0, green = 1 D. An illegal declaration
Q. If memory for the run-time stack is only 150 cells(words), how big can N be in `Factorial(N)` before encountering stack overflow?
 A. 24 B. 15 C. 66 D. 50
Q. Minimum number of interchange needed to convert the array 89, 19, 14, 40,17, 12, 10, 2, 5, 7, 11, 6, 9, 70 into a heap with the maximum element at the root is?
 A. 0 B. 1 C. 2 D. 3

Q. Average successful search time for sequential search on 'n' items is?
 A. n/2 B. (n-1)/2 C. (n+1)/2 D. None of these
Q. In a Circularly Linked List, insertion of a record involves the modification of __________?
 A. No pointer B. 1 pointer C. 2 pointers D. 3 pointers
Q. Which of the following data structure may give overflow error, even though the current number of element in it is less than its size?
 A. Simple queue B. Circular queue C. Stack D. None of these
Q. 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 list
Q. Number of "ADD" and "REMOVE" operations required to access n/2th element of a queue of "n" elements, so that the original queue remains the same after the access is ________ (take help of another queue)?
 A. 4 * n B. 8 * n C. 4 * n - 1 D. 8 * n - 1

Q. A full binary tree with n non-leaf nodes contains __________ .
 A. Log n nodes B. n+1 nodes C. 2n nodes D. 2n + 1 nodes
Q. A 3-ary tree in which every internal node has exactly 3 children. The number of leaf nodes in such an tree with with 6 internals nodes will be?
 A. 10 B. 11 C. 12 D. 13
Q. Average successful search time taken by binary search on a sorted array of 10 items is?
 A. 2.6 B. 2.7 C. 2.8 D. 2.9
Q. A full binary tree with n non-leaf nodes contains?
 A. Log n nodes B. n + 1 nodes C. 2n nodes D. 2n + 1 nodes
Q. Heap allocation is required for languages that __________?
 A. support recursion B. support dynamic data structure C. use dynamic scope rules D. None of these
Q. Let G be a complete undirected planar graph on 10 vertices with 15 edges. If G is a connected graph, then the number of bounded faces in any embedding of G on the plane is equal to?
 A. 3 B. 4 C. 5 D. 6