 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.

 61. The value of j at the end of the execution of the following C program.int incr(int i){ static int count = 0; count = count + i; return (count);}main(){ int i,j; for (i = 0; i <=4; i++) j = incr(i);} a. 10 b. 4 c. 6 d. 7

 62. Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using randomized quicksort? a. O(n) b. O(n Log n) c. O(n^2) d. O(n!)

 63. Consider any array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i <= n), the index of the parent is a. i - 1 b. floor(i/2) c. ceiling(i/2) d. (i+1)/2

 64. What is the minimum number of stacks of size n required to implement a queue of size n? a. One b. Two c. Three d. Four

 65. What is printed by the print statements in the program P1 assuming call by reference parameter passing?Program P1(){ x = 10; y = 3; func1(y,x,x); print x; print y;}func1(x,y,z){ y = y+4; z = x+y+z;} a. 10, 3 b. 31, 3 c. 27, 7 d. None of the above

 66. Consider the following three C functions :[PI] int * g (void) { int x= 10; return (&x); } [P2] int * g (void) { int * px; *px= 10; return px; } [P3] int *g (void) { int *px; px = (int *) malloc (sizeof(int)); *px= 10; return px; }Which of the above three functions are likely to cause problems with pointers? a. Only P3 b. Only P1 and P3 c. Only P1 and P2 d. P1, P2 and P3

 67. Consider the following programProgram P2 var n: int: procedure W(var x: int) begin x=x+1; print x; end procedure D begin var n: int; n=3; W(n); end begin //beginP2 n=10; D; end If the language has dynamic scoping and parameters are passed by reference, what will be printed by the program? a. 10 b. 11 c. 3 d. None of the above