Algorithms and Complexity Homework #6