What is the time complexity of searching for an element in a binary search…
2025
What is the time complexity of searching for an element in a binary search tree, assuming that the tree is balanced?
Answer: B. O(log n) — The time complexity of searching for an element in a balanced binary search tree is O(log n). However, it’s important to note that in the worst-case scenario…
- A.
O(1)
- B.
O(log n)
- C.
O(n)
- D.
O(n log n)
Attempted by 524 students.
Show answer & explanation
Correct answer: B
The time complexity of searching for an element in a balanced binary search tree is O(log n). However, it’s important to note that in the worst-case scenario (if the tree is skewed), the time complexity could become O(n).
Loading lesson…