Professional KnowledgeHardIBPS SO IT

The time to build a binary heap from n arbitrary elements using the bottom-up (Floyd) method is:

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

Correct answer: B. O(n)

Most nodes are near the leaves and sift down short distances, summing to a linear total.

More IT Officer Professional Knowledge (IBPS SO) questions

Exams that ask this topic