What is the relationship between the number of leaf nodes (L) and the number of internal nodes (I) in a full binary tree?
L = 2 * I
L = I
L = I - 1
L = I + 1
Preorder Traversal is often used as a step in which of the following tasks?
Finding the Lowest Common Ancestor (LCA) of two nodes.
Level order traversal of a Binary Tree.
Creating a deep copy of a Binary Tree.
Checking if two Binary Trees are mirrors of each other.
What is the difference between the height and depth of a node in a binary tree?
Height and depth are the same thing.
Height is the number of edges from the node to the deepest leaf, while depth is the number of edges from the root to the node.
Height is always one more than the depth of a node.
Height is the number of edges from the root to the node, while depth is the number of nodes from the root to the node.
What is the time complexity of efficiently finding the diameter of a binary tree?
O(n log n)
O(n^2)
O(n)
O(log n)
What is the primary advantage of using a balanced BST over an unbalanced BST?
Reduced memory usage
Faster insertion operations
Guaranteed constant-time search complexity
Improved worst-case time complexity for search, insertion, and deletion
What is the space complexity of finding the LCA in a Binary Tree using a recursive approach?
O(1)
When performing a search for a value in a BST, what happens if the value is not found?
The search continues indefinitely.
The closest value in the BST is returned.
A null pointer or a special value indicating the absence of the value is returned.
An error is raised.
Which type of binary tree traversal is typically used to delete all nodes in a BST?
Level-order traversal
Preorder traversal
Inorder traversal
Postorder traversal
Which type of binary tree is particularly well-suited for representing relationships where each node has exactly two children (e.g., representing expressions in a compiler)?
Perfect Binary Tree
Skewed Binary Tree
Full Binary Tree
Complete Binary Tree
What is the height of a perfect binary tree with 'n' nodes?
log2(n + 1) - 1
n/2
n - 1
log2(n)