Binary Trees and Traversals - Complexity Analysis - Higher Difficulty Problems

Download Q&A
Q. If a binary tree has a height of 'h', what is the minimum number of nodes it can have?
  • A. h
  • B. h + 1
  • C. 2^h - 1
  • D. 2^h
Q. In a binary tree, what is the maximum number of leaf nodes possible?
  • A. n
  • B. n/2
  • C. 2^h
  • D. 2^(h+1) - 1
Q. What is the average time complexity for inserting an element in a balanced binary search tree?
  • A. O(n)
  • B. O(log n)
  • C. O(n log n)
  • D. O(1)
Q. What is the space complexity of a recursive inorder 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 searching for an element in a binary search tree (BST) in the worst case?
  • A. O(log n)
  • B. O(n)
  • C. O(n log n)
  • D. O(1)
Q. What is the time complexity of the inorder traversal of a binary tree?
  • A. O(n)
  • B. O(log n)
  • C. O(n log n)
  • D. O(1)
Q. What is the worst-case time complexity of the depth-first search (DFS) algorithm on a binary tree?
  • A. O(n)
  • B. O(log n)
  • C. O(n log n)
  • D. O(1)
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