Top 80+ Solved Non Linear Data Structures - Trees MCQ Questions Answer
Q. The following given tree is an example for?
a. Binary tree
b. Binary search tree
c. Fibonacci tree
d. none
Q. What is the traversal strategy used in the binary tree?
a. depth-first traversal
b. breadth-first traversal
c. random traversal
d. Priority traversal
Q. What operation does the following diagram depict?
a. inserting a leaf node
b. inserting an internal node
c. deleting a node with 0 or 1 child
d. none
Q. Using what formula can a parent node be located in an array?
a. (i+1)/2
b. (i-1)/2
c. i/2
d. 2i/2
Q. Which of the following properties are obeyed by all three tree – traversals?
a. Left subtrees are visited before right subtrees
b. Right subtrees are visited before left subtrees
c. Root node is visited before left subtree
d. Root node is visited before right subtree
Q. For the tree below, write the pre-order traversal.
a. 2, 7, 2, 6, 5, 11, 5, 9, 4
b. 2, 7, 5, 2, 6, 9, 5, 11, 4
c. 2, 5, 11, 6, 7, 4, 9, 5, 2
d. none
Q. For the tree below, write the post-order traversal.
a. 2, 7, 2, 6, 5, 11, 5, 9, 4
b. 2, 7, 5, 2, 6, 9, 5, 11, 4
c. 2, 5, 11, 6, 7, 4, 9, 5, 2
d. none
Q. What is the time complexity of pre-order traversal in the iterative fashion?
a. O(1)
b. O(n)
c. O(logn)
d. O(nlogn)
Q. What is the space complexity of the post-order traversal in the recursive fashion? (d is the treedepth and n is the number of nodes)
a. O(1)
b. O(nlogd)
c. O(logd)
d. O(d)