邻接矩阵
邻接表
存储顶点(LeetCode是这样)
class UndirectedGraphNode:
def __init__(self, x):
self.label = x
self.neighbors = []
邻接矩阵
邻接表
存储顶点(LeetCode是这样)
class UndirectedGraphNode:
def __init__(self, x):
self.label = x
self.neighbors = []