Top 80+ Solved Non Linear Data Structures - Trees MCQ Questions Answer

From 31 to 45 of 71

Q. In a binary search tree, which of the following traversals would print the numbers in the ascendingorder?

a. Level-order traversal

b. Pre-order traversal

c. Post-order traversal

d. In-order traversal

  • d. In-order traversal

Q. The number of edges from the root to the node is called of the tree.

a. Height

b. Depth

c. Length

d. Width

  • b. Depth

Q. The number of edges from the node to the deepest leaf is called of the tree.

a. Height

b. Depth

c. Length

d. Width

  • a. Height

Q. What is a full binary tree?

a. Each node has exactly zero or two children

b. Each node has exactly two children

c. All the leaves are at the same level

d. Each node has exactly one or two children

  • a. Each node has exactly zero or two children

Q. What is a complete binary tree?

a. Each node has exactly zero or two children

b. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left

c. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right

d. A tree In which all nodes have degree 2

  • c. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right

Q. What is the average case time complexity for finding the height of the binary tree?

a. h = O(loglogn)

b. h = O(nlogn)

c. h = O(n)

d. h = O(log n)

  • d. h = O(log n)

Q. Which of the following is not an advantage of trees?

a. Hierarchical structure

b. Faster search

c. Router algorithms

d. Undo/Redo operations in a notepad

  • d. Undo/Redo operations in a notepad

Q. In a full binary tree if number of internal nodes is I, then number of leaves L are?

a. L = 2*I

b. L = I + 1

c. L = I – 1

d. L = 2*I – 1

  • b. L = I + 1

Q. In a full binary tree if number of internal nodes is I, then number of nodes N are?

a. N = 2*I

b. N = I + 1

c. N = I – 1

d. N = 2*I + 1

  • d. N = 2*I + 1

Q. In a full binary tree if there are L leaves, then total number of nodes N are?

a. N = 2*L

b. N = L + 1

c. N = L – 1

d. N = 2*L – 1

  • d. N = 2*L – 1

Q. Which of the following is false about a binary search tree?

a. The left child is always lesser than its parent

b. The right child is always greater than its parent

c. The left and right sub-trees should also be binary search trees

d. In order sequence gives decreasing order of elements

  • d. In order sequence gives decreasing order of elements

Q. What is the speciality about the inorder traversal of a binary search tree?

a. It traverses in a non increasing order

b. It traverses in an increasing order

c. It traverses in a random fashion

d. It traverses based on priority of the node

  • b. It traverses in an increasing order

Q. What are the worst case and average case complexities of a binary search tree?

a. O(n), O(n)

b. O(logn), O(logn)

c. O(logn), O(n)

d. O(n), O(logn)

  • d. O(n), O(logn)

Q. What are the conditions for an optimal binary search tree and what is its advantage?

a. The tree should not be modified and you should know how often the keys are accessed, it improves the lookup cost

b. You should know the frequency of access of the keys, improves the lookup time

c. The tree can be modified and you should know the number of elements in the tree before hand, it improves the deletion time

d. The tree should be just modified and improves the lookup time

  • a. The tree should not be modified and you should know how often the keys are accessed, it improves the lookup cost

Q. Which of the following is not the self balancing binary search tree?

a. AVL Tree

b. 2-3-4 Tree

c. Red – Black Tree

d. Splay Tree

  • b. 2-3-4 Tree
Subscribe Now

Get All Updates & News