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
Preorder Traversal is often used as a step in which of the following tasks?
Level order traversal of a Binary Tree.
Finding the Lowest Common Ancestor (LCA) of two nodes.
Checking if two Binary Trees are mirrors of each other.
Creating a deep copy of a Binary Tree.
Perfect binary trees are commonly used in which of the following applications due to their balanced structure and efficient space utilization?
Hash Tables
Heap Sort
Binary Search Trees
Trie Data Structures
Which of the following is a common application of Binary Tree serialization?
Implementing a hash table
Storing and retrieving trees in a file or database
Finding the shortest path in a graph
Sorting data
When performing a search for a value in a BST, what happens if the value is not found?
The closest value in the BST is returned.
An error is raised.
A null pointer or a special value indicating the absence of the value is returned.
The search continues indefinitely.
Is it possible for a full binary tree to have an even number of nodes?
No
Yes
What is the worst-case time complexity of inserting a node into a Binary Search Tree (BST)?
O(1)
O(n)
O(n log n)
O(log n)
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.
One stack stores the nodes in preorder, and the other stores them in inorder, allowing us to derive the postorder.
Two stacks are not strictly required; one stack is sufficient for iterative Postorder Traversal.
What is the time complexity of calculating the height of a binary tree?
O(n^2)
What is the primary advantage of using a balanced BST over an unbalanced BST?
Reduced memory usage
Improved worst-case time complexity for search, insertion, and deletion
Guaranteed constant-time search complexity
Faster insertion operations