Tested BFS
DFS stack, not tested
late