Which of the following is a valid approach for deleting a node with two children in a binary tree?
Replace the node with its inorder successor
Swap the node with its parent
Simply remove the node
None of the above
What is one way to check the validity of a BST during insertion or deletion operations?
Maintaining a separate sorted array to compare with the BST
Checking the BST property locally during the insertion or deletion process
It's not possible to ensure validity during the operations themselves.
Performing a full tree traversal after every operation
In the context of BST insertion, where is a new node with a key smaller than all existing keys typically inserted?
The position depends on the specific implementation
As the left child of the leftmost node
As the new root
As the right child of the rightmost node
What is a common real-world application of binary trees?
Storing sorted data for efficient retrieval
All of the above
Representing hierarchical relationships, like file systems
Implementing algorithms like Huffman coding
The height of a binary tree with 'n' nodes is always:
Cannot be determined from the number of nodes
floor(log2(n)) + 1
n/2
log2(n)
Can a binary tree be empty?
No
Only if it has a root node
Yes
Only if it has leaf nodes
Which data structure is commonly used to implement a binary tree?
Linked List
Queue
Stack
Array
What are the three main methods for traversing a binary tree?
Preorder, Inorder, Postorder
Breadth-first, Depth-first, Level-order
Ascending, Descending, Random
Linear, Binary, Exponential
What is the maximum number of children a node can have in a binary tree?
Unlimited
3
2
1
Which traversal technique is typically used to find the minimum element in a binary search tree?
Postorder Traversal
Inorder Traversal
Preorder Traversal
Level Order Traversal