top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the worse-case time complexity for a binary search tree for searching?

0 votes
450 views
What is the worse-case time complexity for a binary search tree for searching?
posted Nov 4, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

While creating binary search tree if elements are entered into shorted order (ascending/descending) then BST would be right-skewed/left-skewed BST. In these scenario, binary tree would be solely dominated by either left child or right child nodes.
In this case if you want to search an element then it will take O(n) time-complexity. While it is O(log n) when nodes in BST are balanced.

answer Nov 4, 2017 by Harshita
...