Representing a Heap

Can use the multiple-array representation.

Because binary tree is ``complete'' (packed to the left), there is an easier way.

Read off the keys by depth, left to right.

Where are the two children of a node i? How about the parent of i?

How recognize leaf? Parent?


next up previous
Next: Maintaining the Heap Property Up: HEAPS Previous: Some Properties of Heaps