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.

21. How many PUSH and POP operations will be needed to evaluate the following expression by reverse polish notation in a stack machine (A * B) + (C * D/E)?
a. 4 PUSH and 3 POP instructions
b. 5 PUSH and 4 POP instructions
c. 6 PUSH and 2 POP instructions
d. 5 PUSH and 3 POP instructions
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).5 PUSH and 4 POP instructions

22. Consider an array A[20. 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of A[11,5]? Assume row major storage.
a. 560
b. 565
c. 570
d. 575
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).560

23. Convert the following infix expression into its equivalent post fix expression (A + B^D)/(E - F) + G
a. ABD^ + EF-/G+
b. ABD + ^EF-/G+
c. ABD + ^EF/-G+
d. ABD^ + EF/-G+
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).ABD^ + EF-/G+

24. Any decision tree that sorts n elements has height
a. Ω (n)
b. Ω(/gn)
c. Ω(n/gn)
d. Ω(n^2)
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).Ω(n^2)

25. Match the following .
     List- I                                                    List - II
a. Bucket sort                                      i. O(n^3/gn)
b. Matrix chain multiplication           ii. O(n^3) 
c. Huffman codes                             iii. O(nlgn)
d. All pairs shortest paths               iv. O(n)

code:
a   b   c   d
a. iv   ii   i   iii
b. ii   iv   i   iii
c. iv   ii   iii   i
d. iii   ii   iv   i
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).iii   ii   iv   i

26. Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?
a. 4, 254,403, 400,332,346, 399, 365
b. 926,222,913,246,900,260,364,365
c. 927,204,913, 242,914,247,365
d. 4,401,389,221,268, 384,383, 280,365
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).927,204,913, 242,914,247,365

27. Converting a primitive type data into its corresponding wrapper class object instance is called
a. Boxing
b. Wrapping
c. Instantiation
d. Autoboxing
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).Autoboxing

28. Consider the following statements-

(a) Depth - first search is used to traverse a rooted tree. 
(b) Pre - order, Post-order and Inorder are used to list the vertices of an ordered rooted tree.
(c) Huffman's algorithm is used to find an optimal binary tree with given weights.
(d) Topological sorting provides a labelling such that the parents have larger labels than their children.

Which of the above statements are true ?
a. (a) and (b)
b. (c) and (d)
c. (a) , (b) and (c)
d. (a), (b) , (c) and (d)
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).(a), (b) , (c) and (d)

29. The inorder and preorder Traversal of binary Tree are dbeafcg and abdecfg respectively.The post order traversal is ______________.
a. dbefacg
b. debfagc
c. dbefcga
d. debfgca
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).debfgca

30. Level order Traversal of a rooted Tree can be done by starting from root and performing
a. Breadth First Search
b. Depth first search
c. Root search
d. Deep search
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).Breadth First Search

Page 3 of 27