The time complexity of searching in a balanced binary search tree like AVL or red-black tree is _______.

  • O(1)
  • O(log n)
  • O(n)
  • O(n^2)
The time complexity of searching in a balanced binary search tree like AVL or red-black tree is O(log n), where 'n' is the number of elements in the tree. The balanced structure ensures efficient search operations by halving the search space in each step.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *