Python Dfs Implementation Using Stack Infix