Dfs Algorithm Python Binary Search Example