 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.

#### Important Notice!

Dear users, compscibits.com is now permanently moved to compsciedu.com. Please update all your links and bookmarks accordingly. Soon, the site will be accessible through URL compsciedu.com only.

 71. 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

 72. 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 uniformly 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

 73. 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(1)

 74. 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

 75. Consider the following C function.float f(float x, int y){ float p, s; int i; for (s=1, p=1, i=1; i < y; i ++) { p*= x/i; s+=p; } return s;} For large values of y, the return value of the function f best approximates a. x^y b. e^x c. ln(1 + x) d. x^x

 76. Assume the following C variable declarationint *A , B;  Of the following expressions: I A II A III B IV B which will not give compile-time errors if used as left hand sides of assignment statements in a C program? a. I, II, and IV only b. II, III, and IV only c. II and IV only d. IV only

 77. Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree ? a. 7 5 1 0 3 2 4 6 8 9 b. 0 2 4 3 1 6 5 9 8 7 c. 0 1 2 3 4 5 6 7 8 9 d. 9 8 6 4 2 3 0 1 5 7
 79. Consider the following graph. Among the following sequencesI) a b e g h f II) a b f e h g III) a b f h g e IV) a f g h b eWhich are depth first traversals of the above graph? a. I, II and IV only b. I and IV only c. II, III and IV only d. I, III and IV only