exercises from c-programming-book
sorting algorithm