implemented directed graph and completed problem 2 Chapter 4