In what case search function in binary search tree will have O(h + s) complexity, where h is the height and s is item returned? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In what case search function in binary search tree will have O(h + s) complexity, where h is the height and s is item returned?

In the balanced BST search function takes O(logn) depending on key value that compares and traverse left or right subtree. In what case search function takes O(h +s) operation?

11th Feb 2023, 10:27 PM
FERUZ
1 Answer
0
Oh, wow. Great question. You may want to ask this in a computer science discord or reddit page. Sololearn is more so about programming that computer science.
12th Feb 2023, 4:38 PM
Justice
Justice - avatar