Question: What is the runtime complexity of searching for an item in a binary search tree?
- The runtime for searching in a binary search tree is O(1) because each node acts as a key, similar to a dictionary.
- The runtime for searching in a binary search tree is O(n!) because every node must be compared to every other node.
- The runtime for searching in a binary search tree is generally O(h), where h is the height of the tree.
- The runtime for searching in a binary search tree is O(n) because every node in the tree must be visited.
Answer: The correct answer of the above question is Option C:The runtime for searching in a binary search tree is generally O(h), where h is the height of the tree.