What is the time complexity of searching for an element in a balanced binary search tree like AVL or red-black tree?

  • O(1)
  • O(log n)
  • O(n log n)
  • O(n)
The time complexity of searching for an element in a balanced binary search tree, such as AVL or red-black tree, is O(log n), where 'n' is the number of elements in the tree. The balanced structure allows for efficient search operations, maintaining logarithmic time complexity.
Add your answer
Loading...

Leave a comment

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