Exercices from the book Algorithms