Data Structures and Algorithm Xiaoqing Zheng Zhengxq@fudan.edu.cn
Data Structures and Algorithm Data Structures and Algorithm Xiaoqing Zheng zhengxq@fudan.edu.cn
Representations of undirected graph 2 5 3 5)(4 Adjacency-list representation of graph G=(V, E)
Representations ofd d h un directe d grap h 1 2 1 2 5 / 3 2 1 3 4 / 3 2 4 4 2 5 3 / / 5 4 4 2 5 3 / 5 4 1 / Adjacency-list representation of graph G = ( V, E )
Representations of undirected graph 12345 101001 210110 301010 5)(4 510010 Adjacency-matrix representation of graph G=(V, E)
Representations ofd d h un directe d grap h 1 2 12345 1 01001 3 2 10110 3 0 1 0 1 0 5 4 3 0 1 0 1 0 4 01101 5 1 0 0 1 0 d f h 5 1 0 0 1 0 A djacency-matrix representation of grap h G = ( V, E )
Representations of directed graph 4 4(5 6 123456 Adjacency-list representation of graph G=(V, E)
Representations ofd d h irecte d grap h 1 2 3 1 2 4 / 2 5 / 3 6 5 4 2 / / 4 5 4 2 / 6 5 4 / 6 6 / Adjacency-list representation of graph G = ( V, E )
Representations of directed graph 123456 10100 2000010 3000011 4010000 4(5 6 5000100 6000001 Adjacency-matrix representation of graph G=(V, E)
Representations ofd d h irecte d grap h 1 2 3 123456 1 010100 2 000010 3 000011 4 5 6 4 010000 5 000100 d f h 6 000001 A jacency-matrix representation of grap h G = ( V, E )