🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Sorting, heapq and bisect: all 10 questions

Quiz: Sorting, heapq and bisect · Question 4 of 10

After heapq.heapify(a), what is guaranteed?

After heapq.heapify(a), what is guaranteed?

  1. A.The whole list is sorted
  2. B.The largest item is at index 0
  3. C.The smallest item is at index 0
  4. D.The list is reversed
Answer & explanation

Correct answer: The smallest item is at index 0

A min-heap only guarantees that every parent is not larger than its children, so the minimum is at the root.

Can you get the rest right without peeking?

Take the timed Quiz: Sorting, heapq and bisect quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →