Heap Delete Example

We will start with the heap that contains the letters F, E, D, C, B, and A, which were entered in that order.

Initial heap with 6 nodes. Six nodes: A, C, B, F, D, E
Remove the letter A. Six nodes: one empty
Move the last node to the root. Five nodes: E, C, B, F, D
Sift down. Exchange E and B. Five nodes: B, C, E, F, D
Remove the letter B. Five nodes, one empty
Move the last node to the root. Four nodes: D, C, E, F
Sift down. Exchange D and C. Four nodes: C, D, E, F
Remove the letter C. Four nodes: one empty
Move the last node to the root. Three nodes: F, D, E
Sift down. Exchange F and D. Three nodes: D, F, E
Remove the letter D. Three nodes, one empty
Move the last node to the root. Two nodes: E, F