This is the homework of Algorithms...