Example code in "Mastering Algrithms with C"