3 ms·
It depends on the implementation. If you stuff your list in a (lazily constructed) heap, you can get the next element in O(log n) amortized.
by adrianN 11y ago
It depends on the implementation. If you stuff your list in a (lazily constructed) heap, you can get the next element in O(log n) amortized.