Uses Max-Heapify to completely fix a heap using a bottom up manner
Kjøretid:
Runtime
IGNORE UNDER
where , and is average work per node
Since the average work per node converges to a number:
Which is why we get
Search
Jan 06, 2025, 1 min read
Uses Max-Heapify to completely fix a heap using a bottom up manner
Kjøretid: O(nlgn)
IGNORE UNDER
T(n)=2hi=0∑h2ii=Θ(n)i=0∑h2iiwhere h=lg(n), and ∑i=0h2ii is average work per node
Since the average work per node converges to a number:
i=0∑h2ii=Θ(1)Which is why we get
T(n)=Θ(n)