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
A) O(logN)
B) O(N)
C) O(NlogN)
D) O(N^2)
How is O(N) correct answer. Please explain.
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
A) O(logN)
B) O(N)
C) O(NlogN)
D) O(N^2)
How is O(N) correct answer. Please explain.