mirror of
https://github.com/krahets/hello-algo.git
synced 2025-02-02 22:43:50 +08:00
Fix a comment in graph_adjacency_list
This commit is contained in:
parent
73c8920c6b
commit
adbb12c011
@ -12,7 +12,7 @@ namespace hello_algo.chapter_graph;
|
||||
/* 基于邻接表实现的无向图类 */
|
||||
class GraphAdjList
|
||||
{
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接结点
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接顶点
|
||||
Dictionary<Vertex, List<Vertex>> adjList;
|
||||
|
||||
/* 构造函数 */
|
||||
|
@ -11,7 +11,7 @@ import include.*;
|
||||
|
||||
/* 基于邻接表实现的无向图类 */
|
||||
class GraphAdjList {
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接结点
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接顶点
|
||||
Map<Vertex, List<Vertex>> adjList;
|
||||
|
||||
/* 构造方法 */
|
||||
|
@ -8,8 +8,7 @@ const { Vertex } = require('../include/Vertex')
|
||||
|
||||
/* 基于邻接表实现的无向图类 */
|
||||
class GraphAdjList {
|
||||
// 邻接表,使用哈希表来代替链表,以提升删除边、删除顶点的效率
|
||||
// 请注意,adjList 中的元素是 Vertex 对象
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接顶点
|
||||
adjList;
|
||||
|
||||
/* 构造方法 */
|
||||
|
@ -11,7 +11,7 @@ from include import *
|
||||
|
||||
""" 基于邻接表实现的无向图类 """
|
||||
class GraphAdjList:
|
||||
# 邻接表,key: 顶点,value:该顶点的所有邻接结点
|
||||
# 邻接表,key: 顶点,value:该顶点的所有邻接顶点
|
||||
adj_list = {}
|
||||
|
||||
""" 构造方法 """
|
||||
|
@ -8,8 +8,7 @@ import utils
|
||||
|
||||
/* 基于邻接表实现的无向图类 */
|
||||
public class GraphAdjList {
|
||||
// 邻接表,使用哈希表来代替链表,以提升删除边、删除顶点的效率
|
||||
// 请注意,adjList 中的元素是 Vertex 对象
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接顶点
|
||||
public private(set) var adjList: [Vertex: [Vertex]]
|
||||
|
||||
/* 构造方法 */
|
||||
|
@ -8,8 +8,7 @@ import { Vertex } from "../module/Vertex";
|
||||
|
||||
/* 基于邻接表实现的无向图类 */
|
||||
class GraphAdjList {
|
||||
// 邻接表,使用哈希表来代替链表,以提升删除边、删除顶点的效率
|
||||
// 请注意,adjList 中的元素是 Vertex 对象
|
||||
// 邻接表,key: 顶点,value:该顶点的所有邻接顶点
|
||||
adjList: Map<Vertex, Vertex[]>;
|
||||
|
||||
/* 构造方法 */
|
||||
|
Loading…
Reference in New Issue
Block a user