What is the space complexity of finding the LCA in a Binary Tree using a recursive approach?
O(1)
O(n)
O(log n)
O(n log n)
Which type of binary tree has the strictest structure, requiring all levels to be completely filled and all leaf nodes to be at the same level?
Perfect Binary Tree
Full Binary Tree
Balanced Binary Tree
Complete Binary Tree
What is the relationship between the number of leaf nodes (L) and the number of internal nodes (I) in a full binary tree?
L = I - 1
L = I
L = I + 1
L = 2 * I
Perfect binary trees are commonly used in which of the following applications due to their balanced structure and efficient space utilization?
Hash Tables
Binary Search Trees
Heap Sort
Trie Data Structures
A complete binary tree with 'n' nodes has a height of?
n - 1
n/2
log2(n) + 1
floor(log2(n))
Which of the following is a common application of Binary Tree serialization?
Sorting data
Implementing a hash table
Finding the shortest path in a graph
Storing and retrieving trees in a file or database
What is the height of a perfect binary tree with 'n' nodes?
log2(n + 1) - 1
log2(n)
Why are two stacks often used in the iterative implementation of Postorder Traversal?
Two stacks are not strictly required; one stack is sufficient for iterative Postorder Traversal.
One stack is used for the left subtree traversal, and the other for the right subtree traversal.
One stack stores the nodes in preorder, and the other stores them in inorder, allowing us to derive the postorder.
One stack stores the nodes to be visited, and the other stores the visited nodes.
Inorder Traversal is particularly useful for which of the following applications?
Printing the nodes of a BST in sorted order.
Finding the diameter of a Binary Tree.
Checking if a Binary Tree is balanced.
Finding the height of a Binary Tree.
Which traversal algorithm is most suitable for finding the Lowest Common Ancestor (LCA) of two nodes in a Binary Tree?
Postorder Traversal
Level Order Traversal
Any of the above
Preorder Traversal