Solutions to questions in book Algorithms