The example implementations for DFS and BFS show calls to functions PreVisit and PostVisit. Better is to implement BFS and DFS using the visitor design pattern, with the visitor functions being passed in as either function or template parameters. Reimplement the BFS and DFS functions to make use of the visitor design pattern.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here