Perfect binary trees are commonly used in which of the following applications due to their balanced structure and efficient space utilization?
Heap Sort
Hash Tables
Trie Data Structures
Binary Search Trees
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?
Full Binary Tree
Complete Binary Tree
Perfect Binary Tree
Balanced Binary Tree
Given a serialized representation of a Binary Tree, can we reconstruct the original tree uniquely?
Only if we have additional information about the tree structure
Yes, always
No, never
Only if the tree is a BST
How can you identify leaf nodes during a preorder traversal of a binary tree?
It is not possible to identify leaf nodes during preorder traversal.
A node is a leaf if both its left and right child pointers are NULL.
A node is a leaf if it is visited before its children.
A node is a leaf if its value is less than its parent's value.
Why are two stacks often used in the iterative implementation of Postorder Traversal?
One stack is used for the left subtree traversal, and the other for the right subtree traversal.
One stack stores the nodes to be visited, and the other stores the visited nodes.
Two stacks are not strictly required; one stack is sufficient for iterative Postorder Traversal.
One stack stores the nodes in preorder, and the other stores them in inorder, allowing us to derive the postorder.
Which data structure is used in the iterative implementation of Preorder Traversal?
Queue
Heap
Stack
Linked List
What is the primary advantage of using an iterative approach (with a stack) over recursion for Inorder Traversal?
Iterative traversal is generally faster.
There is no significant advantage; both approaches have similar performance.
Iterative traversal is easier to understand and implement.
Iterative traversal avoids function call overhead and potential stack overflow for very deep trees.
What is the time complexity of searching for a specific value in a perfectly balanced BST?
O(log n)
O(n log n)
O(n)
O(1)
What is the time complexity of calculating the height of a binary tree?
O(n^2)
What is the output of Preorder Traversal for the following Binary Tree: 1(2(4,5),3)?
4 5 2 3 1
1 2 4 5 3
1 3 2 4 5
4 2 5 1 3