Modify the method breadth First Traverse () (Figure 15–21) so that it returns an Iterator instead of a List. Your version should not simply create a List and then ask it for an Iterator. Instead, create a Breadth First Graphterator class which maintains the queue and the set of visited vertices.
Figure 15–21
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here