Heap 的讲解 - 时间复杂度

Inserting
Time complexity: O(log N)
Space complexity: O(1)

Getting the top element of the Heap
Time complexity: O(1)
Space complexity: O(1)

Deleting the top element
Time complexity: O(log N)
Space complexity: O(1)

Getting the length of a Heap
Time complexity: O(1)
Space complexity: O(1)

おすすめ

転載: blog.csdn.net/BSCHN123/article/details/121488573