Professional KnowledgeHardIBPS SO IT

Time to build a BST from n keys already sorted in ascending order by successive insertion is:

  1. A. O(n^2)
  2. B. O(n log n)
  3. C. O(n)
  4. D. O(log n)

Correct answer: A. O(n^2)

The tree degenerates into a chain, so the i-th insertion costs O(i).

More IT Officer Professional Knowledge (IBPS SO) questions

Exams that ask this topic