-
We have a binary heap on n elements and wish to insert n more elements (not necessarily one after another) into this heap. The total time required for this is
-
- Θ (log n)
- Θ (n)
- Θ (n log n)
- Θ (n2)
- Θ (log n)
Correct Option: B
Heaps are implemented as simple arrays, to insert n more elements each element take Θ(1) time. So total time would be Θ(n).