A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

 101. Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs identify a tree uniquely ?(i) preorder and postorder(ii) inorder and postorder(iii) preorder and inorder(iv) level order and postorder a. (i) only b. (ii), (iii) c. (iii) only d. (iv) only

 102. A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time? a. rear node b. front node c. not possible with a single pointer d. node next to front

 103. The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The resultant Max Heap is. a. a b. b c. c d. d

 104. Two matrices M1 and M2 are to be stored in arrays A and B respectively. Each array can be stored either in row-major or column-major order in contiguous memory locations. The time complexity of an algorithm to compute M1 × M2 will be a. best if A is in row-major, and B is in column- major order b. best if both are in row-major order c. best if both are in column-major order d. independent of the storage scheme

 105. Consider the following C programmain(){ int x, y, m, n; scanf ("%d %d", &x, &y); /* Assume x > 0 and y > 0 */ m = x; n = y; while (m! = n) { if (m > n) m = m - n; else n = n - m; } print f ("% d", n);}The program computes a. x ÷ y using repeated subtraction b. x mod y using repeated subtraction c. the greatest common divisor of x and y d. the least common multiple of x and y

 106. What does the following algorithm approximate? x = m; y = 1; while (x - y > e) { x = (x + y)/2; y = m/x; } print(x);(Assume m > 1, e > 0). a. log m b. m^2 c. m^1/2 d. m^1/3

 107. Consider the following C program segmentstruct CellNode{ struct CelINode *leftchild; int element; struct CelINode *rightChild;}int Dosomething(struct CelINode *ptr){ int value = 0; if (ptr != NULL) { if (ptr->leftChild != NULL) value = 1 + DoSomething(ptr->leftChild); if (ptr->rightChild != NULL) value = max(value, 1 + DoSomething(ptr->rightChild)); } return (value);}The value returned by the function DoSomething when a pointer to the root of a non-empty tree is passed as argument is a. The number of leaf nodes in the tree b. The number of nodes in the tree c. The number of internal nodes in the tree d. The height of the tree