Can someone tell me how do you decide the time complexity of heap insertion/deletion operation?
Anonymous User
115

Insertion of N elements in heap of size takes O(nlogn) can you explain why it is O(nlogk) here? https://leetcode.com/problems/merge-k-sorted-lists/

How do you proceed with the calculation? I understand it is stated as O(logn) but in some cases we do O(logk). Is it depended on the levels?

Comments (1)