Questions: Binary Search Trees

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

You insert the integers 1, 2, 3, 4, 5 into a BST in that order. What is the time complexity of a subsequent search operation?

AO(log n), because a BST always organizes data for binary search
BO(n), because sorted insertions produce a degenerate tree with height n
CO(n log n), because the tree must be rebuilt before searching
DO(1), because the last inserted node is always the root
Question 2 Multiple Choice

To delete a node with two children from a BST, you should replace it with which value?

AThe node's parent, then reattach both subtrees to the grandparent
BThe in-order successor (leftmost node of the right subtree) or in-order predecessor, then delete that successor
CThe root of the right subtree, discarding the left subtree to preserve the BST property
DThe average of the left and right children's keys
Question 3 True / False

A BST containing 15 nodes typically supports search in O(log 15) steps.

TTrue
FFalse
Question 4 True / False

An in-order traversal of a BST visits nodes in sorted (ascending) order.

TTrue
FFalse
Question 5 Short Answer

Why is insertion order the critical factor in BST performance, and what is the worst-case insertion pattern?

Think about your answer, then reveal below.