Binary Trees and Traversals - Complexity Analysis - Case Studies

Download Q&A
Q. In a binary tree, how many edges are there if there are n nodes?
  • A. n-1
  • B. n
  • C. n+1
  • D. 2n
Q. In a binary tree, what is the maximum number of leaf nodes?
  • A. n
  • B. n/2
  • C. 2^(h-1)
  • D. 2^h
Q. In a complete binary tree, how many nodes are there at level k?
  • A. 2^k
  • B. 2^(k+1)
  • C. 2^(k-1)
  • D. k^2
Q. What is the space complexity of a breadth-first traversal of a binary tree?
  • A. O(n)
  • B. O(log n)
  • C. O(1)
  • D. O(n log n)
Q. What is the time complexity of a binary search algorithm on a sorted array?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. What is the time complexity of finding the maximum element in a binary search tree?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. What is the time complexity of searching for an element in a binary search tree (BST) in the average case?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. What is the worst-case time complexity for inserting an element into a binary search tree?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. Which of the following is true about the level-order traversal of a binary tree?
  • A. It is depth-first
  • B. It uses a stack
  • C. It visits nodes level by level
  • D. It is faster than in-order traversal
Q. Which traversal method visits the nodes of a binary tree in the order of left child, root, right child?
  • A. Pre-order
  • B. In-order
  • C. Post-order
  • D. Level-order
Showing 1 to 10 of 10 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely