noodling around with dfs and bfs in c++11