Preorder Traversal is often used as a step in which of the following tasks?
Finding the Lowest Common Ancestor (LCA) of two nodes.
Creating a deep copy of a Binary Tree.
Level order traversal of a Binary Tree.
Checking if two Binary Trees are mirrors of each other.
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 - 1
L = 2 * I
L = I
What is the difference between the height and depth of a node in a binary tree?
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.
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 and depth are the same thing.
Which data structure is most suitable for implementing Level Order Traversal efficiently?
Linked List
Stack
Queue
Binary Heap
If a perfect binary tree has a height of 'h', how many nodes are present in the tree?
h^2
2^h - 1
2^(h+1) - 1
2h
What is the difference between Postorder and Inorder Traversal?
Postorder visits the left subtree, then the right subtree, and finally the root, while Inorder visits the left subtree, the root, and then the right subtree.
Postorder visits the root node before its children, while Inorder visits the root between its left and right children.
Postorder is used for deleting nodes in a Binary Tree, while Inorder is used for printing the nodes in sorted order.
There is no significant difference; both traversals produce the same output.
What is the space complexity of finding the LCA in a Binary Tree using a recursive approach?
O(1)
O(log n)
O(n)
O(n log n)
Which type of binary tree traversal is typically used to delete all nodes in a BST?
Inorder traversal
Postorder traversal
Preorder traversal
Level-order traversal
What is the advantage of using a level order serialization for a Binary Tree?
Preserves the level order traversal of the tree
Easier to implement than other serialization methods
More efficient for finding the LCA
Reduced space complexity
What is the relationship between the depth of a node and its index in an array-based representation of a complete Binary Tree?
Depth = 2 * Index
Depth = Index
Depth = log2(Index + 1)
Depth = Index / 2