We will start with an empty heap and add the letters F, E, D, C, B, and A in that order.
Create an empty heap with an empty root node. ![]()
Insert the letter F. ![]()
Append an empty node. ![]()
Insert the letter E. ![]()
Bubble up. Exchange E and F. ![]()
Append an empty node. ![]()
Insert the letter D. ![]()
Bubble up. Exchange D and E. ![]()
Append an empty node. ![]()
Insert the letter C. ![]()
Bubble up. Exchange C and F. ![]()
Bubble up. Exchange C and D. ![]()
Append an empty node. ![]()
Insert the letter B. ![]()
Bubble up. Exchange B and D. ![]()
Bubble up. Exchange B and C. ![]()
Append an empty node. ![]()
Insert the letter A. ![]()
Bubble up. Exchange A and E. ![]()
Bubble up. Exchange A and B. ![]()