Binary Trees and Traversals - Competitive Exam Level

Download Q&A
Q. In a binary tree, if a node has two children, how many nodes are there in its subtree?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. What is the height of a binary tree with n nodes in the worst case?
  • A. O(log n)
  • B. O(n)
  • C. O(n log n)
  • D. O(1)
Q. What is the height of a complete binary tree with n nodes?
  • A. log(n)
  • B. n
  • C. log(n + 1)
  • D. n/2
Q. What is the space complexity of a recursive traversal of a binary tree?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n log n)
Q. What is the time complexity of inserting an element in a binary search tree in the average case?
  • A. O(log n)
  • B. O(n)
  • C. O(n log n)
  • D. O(1)
Q. Which of the following is true about the inorder traversal of a binary search tree?
  • A. It visits nodes in random order.
  • B. It visits nodes in descending order.
  • C. It visits nodes in ascending order.
  • D. It visits only the leaf nodes.
Q. Which of the following traversal methods uses a queue?
  • A. Inorder
  • B. Preorder
  • C. Postorder
  • D. Level Order
Showing 1 to 7 of 7 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely