다음 예제 실행 결과다.
Enter words separated by spaces, enter Ctrl+Z on a separate line to end:
one two three four five six seven
^Z
The words in the list are:
one two three four five
six seven
After making a heap, the words in the list are:
two one three four five
six seven
You entered 7 words. Enter some more:
eight nine ten twelve fifteen ninety forty fifty-three
^Z
The words in the list are now:
two twelve three nine ten
six seven eight four five
one fifteen ninety forty fifty-three