Multiple choice

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

  1. O(1)

  2. O(log n)

  3. O(n)

  4. O(n log n)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

For skewed binary search tree on n nodes, the tightest upper bound to insert a node is O(n).