The cost is the sum of insertions plus the deletions.
- Unordered List
N insertions costs N (really some small constant times N) 15 deletions costs about 15N (may have to search all items) Total = 16N
- MaxHeap implementation
N insertions costs Nlog(N) 15 deletions costs about 15log(N) Total = Nlog(N) + 15log(N)
If log(N) > 16 (that is, N > 216 ~ 65000), max heap is more expensive.