184k views
2 votes
8. Which has a faster runtime: build Heap() or building a heap with N heap insertion calls? What is the runtime of buildHeap()?

User Brunofitas
by
7.8k points

1 Answer

3 votes

if you have all the elements upfront and want to create a heap, it is more efficient to use the `buildHeap()` operation.

User Chalo
by
8.2k points