Question 31
What is the time complexity of deleting a node from a BST in terms of its height h?
Searching for the node and repairing links take O(h).
What is the time complexity of deleting a node from a BST in terms of its height h?
Searching for the node and repairing links take O(h).
Which BST deletion case requires no subtree replacement?
A leaf can simply be removed.
What is the inorder predecessor of a node with a nonempty left subtree?
The predecessor is the rightmost node of the left subtree.
What is the inorder successor of a node with a nonempty right subtree?
The successor is the leftmost node of the right subtree.
Which traversal is commonly used to serialize a binary tree while preserving null-child markers?
Preorder with explicit null markers uniquely captures the tree structure.