an "inside-out" traversal for graph. implements both bfs and dfs.
fix a silly bug with stack where a sequence of push-pop-push operation
panics
another test for push-pop-push sequence for queue as well.