Binary Trees and Traversals

Download Q&A
Q. How many leaf nodes can a binary tree with n internal nodes have?
  • A. n + 1
  • B. n
  • C. 2n
  • D. n - 1
Q. In which traversal method are nodes visited in the order of left child, root, right child?
  • A. Pre-order
  • B. Post-order
  • C. In-order
  • D. Level-order
Q. In which traversal method do you visit the left subtree, then the root, and finally the right subtree?
  • A. Pre-order
  • B. In-order
  • C. Post-order
  • D. Level-order
Q. What is the height of a binary tree with only one node?
  • A. 0
  • B. 1
  • C. 2
  • D. It cannot be determined
Q. What is the main characteristic of a binary tree?
  • A. Each node has at most two children.
  • B. Each node can have any number of children.
  • C. All nodes must have two children.
  • D. It must be balanced.
Q. What is the maximum number of nodes in a binary tree of height h?
  • A. h
  • B. 2^h - 1
  • C. 2^h
  • D. h^2
Q. What is the post-order traversal of the binary tree with root A, left child B, and right child C?
  • A. A B C
  • B. B A C
  • C. B C A
  • D. C B A
Q. Which of the following is NOT a characteristic of a binary search tree?
  • A. Left subtree contains only nodes with values less than the root.
  • B. Right subtree contains only nodes with values greater than the root.
  • C. Both subtrees must be binary search trees.
  • D. All nodes must have two children.
Q. Which of the following is true about a complete binary tree?
  • A. All levels are fully filled except possibly the last level.
  • B. All nodes have two children.
  • C. It is always balanced.
  • D. It has a maximum height of log n.
Q. Which traversal method is best for obtaining a sorted list from a binary search tree?
  • A. Pre-order
  • B. In-order
  • C. Post-order
  • D. Level-order
Q. Which traversal method is best for printing the nodes of a binary tree level by level?
  • A. In-order
  • B. Pre-order
  • C. Post-order
  • D. Level-order
Q. Which traversal method visits the root node first in a binary tree?
  • A. In-order
  • B. Post-order
  • C. Pre-order
  • D. Level-order
Showing 1 to 12 of 12 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely