A directory of Objective Type Questions covering all the Computer Science subjects.

1.
The following formula is of :


left_subtree (keys) ≤ node (key) ≤ right_subtree (keys)
a. Bianry Tree
b. Complete Binary Tree
c. Binary Search Tree
d. All of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Binary Search Tree

2.
Binary search tree has best case run-time complexity of Ο(log n). What could the worst case?
a. Ο(n)
b. Ο(n2)
c. Ο(n3)
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).Ο(n)

3.
In order traversal of binary search tree will produce −
a. unsorted list
b. reverse of input
c. sorted list
d. none of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).sorted list

4.
In binary heap, whenever the root is removed then the rightmost element of last level is replaced by the root. Why?
a. It is the easiest possible way.
b. To make sure that it is still complete binary tree.
c. Because left and right subtree might be missing.
d. None of the above.
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).To make sure that it is still complete binary tree.

5.
If we choose Prim's Algorithm for uniquely weighted spanning tree instead of Kruskal's Algorithm, then
a. we'll get a different spanning tree.
b. we'll get the same spanning tree.
c. spanning will have less edges.
d. spanning will not cover all vertices.
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).we'll get the same spanning tree.

6.
The number of binary trees with 3 nodes which when traversed in post order gives the sequence A,B,C is ?
a. 3
b. 4
c. 5
d. 6
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).5

7.
Which method can find if two vertices x & y have path between them?
a. Depth First Search
b. Breadth First Search
c. Both A & B
d. None A or B
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Both A & B

8.
Access time of a binary search tree may go worse in terms of time complexity upto
a. Ο(n2)
b. Ο(n log n)
c. Ο(n)
d. Ο(1)
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Ο(n)

9.
Visiting root node after visiting left and right sub-trees is called
a. In-order Traversal
b. Pre-order Traversal
c. Post-order Traveral
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Post-order Traveral

10.
In the deletion operation of max heap, the root is replaced by
a. next available value in the left sub-tree.
b. next available value in the right sub-tree.
c. any random value from the heap.
d. last element of the last level
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).last element of the last level

Page 1 of 12

copyright 2016 computer science bitsCompscibits.com