mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
Unify the comment style of python codes
This commit is contained in:
@ -69,7 +69,7 @@ class GraphAdjList:
|
||||
print(f"{vertex.val}: {tmp},")
|
||||
|
||||
|
||||
""" Driver Code """
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
# 初始化无向图
|
||||
v = vals_to_vets([1, 3, 2, 5, 4])
|
||||
|
@ -84,7 +84,7 @@ class GraphAdjMat:
|
||||
print_matrix(self.adj_mat)
|
||||
|
||||
|
||||
""" Driver Code """
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
# 初始化无向图
|
||||
# 请注意,edges 元素代表顶点索引,即对应 vertices 元素索引
|
||||
|
@ -35,7 +35,7 @@ def graph_bfs(graph: GraphAdjList, start_vet: Vertex) -> list[Vertex]:
|
||||
return res
|
||||
|
||||
|
||||
""" Driver Code """
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
# 初始化无向图
|
||||
v = vals_to_vets([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
|
||||
|
@ -34,7 +34,7 @@ def graph_dfs(graph: GraphAdjList, start_vet: Vertex) -> list[Vertex]:
|
||||
return res
|
||||
|
||||
|
||||
""" Driver Code """
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
# 初始化无向图
|
||||
v = vals_to_vets([0, 1, 2, 3, 4, 5, 6])
|
||||
|
Reference in New Issue
Block a user