[算法题]BFS/DFS/拓扑排序 模板题Python代码 LC785.判断二分图 LeetCode 785 方法一: BFS + 染色 class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: # BFS from collections import deque n = len(graph) UNCOLORED, RED, GREEN = 0, 1, 2 color = [UNCOLORED]*n # 暂时...