← Quiz: Binary Search Tree Operations: all 15 questions
Quiz: Binary Search Tree Operations · Question 9 of 15
To find the k-th smallest key in a BST, the simplest correct method is to:
To find the k-th smallest key in a BST, the simplest correct method is to:
- A.Take the k-th node in level order
- B.Do an inorder traversal and stop at the k-th visited key
- C.Go left k times from the root
- D.Take the k-th node in preorder
Answer & explanation
Correct answer: Do an inorder traversal and stop at the k-th visited key
Inorder visits keys in increasing order, so the k-th visit is the k-th smallest.
Can you get the rest right without peeking?
Take the timed Quiz: Binary Search Tree Operations quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →