in DS recategorized by
528 views
2 votes
2 votes

Consider a Binary Search Tree is created using element 1 to n in following order:

                      3, 2, 1, 6, 5, 4, 9, 8, 7, 12, 11, 10, ....., n – 3, n – 4, n – 5, n – 2, n – 1, n

What is the worst time complexity of searching a number in the Binary Search Tree?

in DS recategorized by
by
528 views

3 Comments

For large number n, O(n) ?
0
0
answer given is : O(logn)
0
0

same question and already answered https://gateoverflow.in/189303/bst-test-series

1
1

1 Answer

0 votes
0 votes
time complexity would be O(n)

since the height will be n/3

Related questions