next up previous
Next: BuildHeap Up: CSE 2320: Algorithms and Previous: Pseudocode

Recursive Analysis


n = 5, nsubtree = \(\lfloor 2n/3 \rfloor\) = 3

Note that this expression has the maximum value when the lowest level of the heap is exactly half full.

T(n) = T($\lfloor$ 2n/3 $\rfloor$) + $\Theta(1)$

T(n) = \(\Theta(lg n)\).

Copyright © 1998 The University of Texas at Arlington