edited by
687 views
2 votes
2 votes

Which one of the following is the tightest upper bound that represents the time complexity of inserting an element into a binary search tree of n nodes?

  1. O(1)
  2. O(n log n)
  3. O(n)  
  4. O(log n)
edited by

1 Answer

2 votes
2 votes

in worst case the tree can grow up to the height of n (skewed tree), therefore tightest upper bound is O(n)

Answer:

Related questions

0 votes
0 votes
1 answer
1
Bikram asked Nov 26, 2016
317 views
Two adjacent edges in a simple graph are said to be in series if their common vertex is of degree ____.1234
0 votes
0 votes
1 answer
3
Bikram asked Nov 26, 2016
1,637 views
Three algorithms do the same task. Algorithm One is $O(N)$ and Algorithm Two is $O(\log N)$ and Algorithm Three is $O(N1/2)$. Which algorithm should execute the fastest f...
1 votes
1 votes
3 answers
4