What is binary search tree ? Discuss the advantege of it?
Answers
Answered by
0
Héllø Buddy!!
⭐♥⭐♥⭐♥⭐
Here Is Your Answer. ↓↓
⭐❤⭐❤⭐❤⭐❤⭐❤
@Answer →→ It's in the name. Binary search trees allow a quick search of items.
Consider an array A of n elements. If you search for k in A, the worst case scenario is that all items in A will be examined. That means the time complexity the search is O(n).
Now consider a binary tree T. A search for k in T will only have to search at most h elements, where h is the height of the tree. Since the time grows with the height, the complexity is O (log n ), a big improvement over O (n).
[] ThankYou []
⭐♥⭐♥⭐♥⭐
Here Is Your Answer. ↓↓
⭐❤⭐❤⭐❤⭐❤⭐❤
@Answer →→ It's in the name. Binary search trees allow a quick search of items.
Consider an array A of n elements. If you search for k in A, the worst case scenario is that all items in A will be examined. That means the time complexity the search is O(n).
Now consider a binary tree T. A search for k in T will only have to search at most h elements, where h is the height of the tree. Since the time grows with the height, the complexity is O (log n ), a big improvement over O (n).
[] ThankYou []
Answered by
0
What is binary search tree ? Discuss the advantege of it?
Similar questions