When deleting a node with two children in a BST, which node is typically chosen as its replacement to maintain the BST properties?
The node with the smallest key in the right subtree
The node with the largest key in the left subtree
Either of the above options can be used
A new node with the average key of its children
Which traversal method on a BST will visit the nodes in ascending order of their keys?
Level-order Traversal
Pre-order Traversal
In-order Traversal
Post-order Traversal
What is the primary advantage of using a BST over a sorted array for storing data when frequent insertions and deletions are required?
BSTs are easier to implement.
BSTs offer faster search times.
BSTs use less memory.
BSTs handle insertions and deletions more efficiently.
To find the maximum element in a binary tree that is not a binary search tree, which traversal method is generally most suitable?
Inorder Traversal
Any traversal method can be used
Preorder Traversal
Postorder Traversal
A node's direct descendant in a binary tree is called its:
Ancestor
Parent
Sibling
Child
A complete binary tree with 'n' nodes will always have a height of:
n/2
floor(log2(n)) + 1
log2(n)
n
Which of the following is a valid approach for deleting a node with two children in a binary tree?
None of the above
Swap the node with its parent
Simply remove the node
Replace the node with its inorder successor
What are the three main methods for traversing a binary tree?
Breadth-first, Depth-first, Level-order
Linear, Binary, Exponential
Preorder, Inorder, Postorder
Ascending, Descending, Random
What is the worst-case time complexity for searching for a node in a balanced binary tree?
O(log n)
O(n)
O(n^2)
O(1)
If a binary tree is considered balanced, what does it imply about its left and right subtrees?
One subtree is always a mirror image of the other.
They have the same number of nodes.
They have the same height.
They are also balanced binary trees, and their heights differ by at most 1.