answersLogoWhite

0


Best Answer

O(h)

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In binary search tree n equals nodes h equals height of tree what is time complexity?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the binary search tree worst case time complexity?

Binary search is a log n type of search, because the number of operations required to find an element is proportional to the log base 2 of the number of elements. This is because binary search is a successive halving operation, where each step cuts the number of choices in half. This is a log base 2 sequence.


Prove by mathematical induction that the complexity of binary search algorithm is log n?

The complexity of the binary search algorithm is log(n)...If you have n items to search, you iteratively pick the middle item and compare it to the search term. Based on that comparision, you then halve the search space and try again. The number of times that you can halve the search space is the same as log2n. This is why we say that binary search is complexity log(n).We drop the base 2, on the assumption that all methods will have a similar base, and we are really just comparing on the same basis, i.e. apples against apples, so to speak.


What is the time complexity for searching an element in an array?

If the array is unsorted, the complexity is O(n) for the worst case. Otherwise O(log n) using binary search.


How height of binary search tree effect its performance?

Each level of height adds another layer that you must progress through so it is slower.


What is average case complexity of binary search?

Average case complexity for Binary search O(log N). (Big O log n)Habibur Rahman (https://www.facebook.com/mmhabib89)BUBT University Bangladeshhttp://www.bubt.edu.bd/

Related questions

What is complexity of binary search tree?

The complexity of binary search tree : Search , Insertion and Deletion is O(h) . and the Height can be of O(n) ( if the tree is a skew tree). For Balanced Binary Trees , the Order is O(log n).


what is the complexity of binary search?

Deezzzz Nutzzzz


What is the height of binary search tree in worst case?

In the worst case a binary search tree is linear and has a height equal to the number of nodes. so h=O(h).


What is the binary search tree worst case time complexity?

Binary search is a log n type of search, because the number of operations required to find an element is proportional to the log base 2 of the number of elements. This is because binary search is a successive halving operation, where each step cuts the number of choices in half. This is a log base 2 sequence.


Prove by mathematical induction that the complexity of binary search algorithm is log n?

The complexity of the binary search algorithm is log(n)...If you have n items to search, you iteratively pick the middle item and compare it to the search term. Based on that comparision, you then halve the search space and try again. The number of times that you can halve the search space is the same as log2n. This is why we say that binary search is complexity log(n).We drop the base 2, on the assumption that all methods will have a similar base, and we are really just comparing on the same basis, i.e. apples against apples, so to speak.


Describe the sequential and binary search develop the algorithms for the same?

both seach has different algorithem but the complexity will be same...


How to find height of subtree in a Binary tree?

Check this out! http://stackoverflow.com/questions/575772/the-best-way-to-calculate-the-height-in-a-binary-search-tree-balancing-an-avl


What is the time complexity for searching an element in an array?

If the array is unsorted, the complexity is O(n) for the worst case. Otherwise O(log n) using binary search.


Why binary search is used for the large values of arrays?

Binary search is used for large arrays because it is the fastest search, on the order of O-Log2-N complexity, which means that the maximum number of compare operations to find a specific item is Log2N, where N is the number of elements.


How height of binary search tree effect its performance?

Each level of height adds another layer that you must progress through so it is slower.


What is average case complexity of binary search?

Average case complexity for Binary search O(log N). (Big O log n)Habibur Rahman (https://www.facebook.com/mmhabib89)BUBT University Bangladeshhttp://www.bubt.edu.bd/


What is the height of a binary tree with n nodes in the worst case?

For the height `h' of a binary tree, for which no further attributes are given than the number `n' of nodes, holds:ceil( ld n)