What is the worst-case time complexity of searching in an unbalanced Binary Search Tree?

17 views
  • O(log n)
  • O(n) (Correct Answer)
  • O(n log n)
  • O(1)

Explanation

In an unbalanced BST, the tree can degenerate into a linked list (e.g., sorted input). In such cases, searching requires traversing all nodes, leading to O(n) time complexity instead of the optimal O(log n).

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs