Exercise code for the book of Algorithm 4th C/C++ version