https://github.com/arunkumar201/graph_adjacency_matrix
An adjacency array is a two-dimension array defined as a[i][j] = {1 if there is an edge (i, j) 0 if there is no edge (i, j) 1.Assuming the graph has n vertices, the time complexity to build such a matrix is O(n^2}. The space complexity is also O(n^2). 2.The advantage of such representation is that we can check in O(1)} time if there exists edge by simply checking the value at i^th row and j^th column of our matrix. 3.to Identifying all edges takes Θ(n2) time.
https://github.com/arunkumar201/graph_adjacency_matrix
Last synced: 9 months ago
JSON representation
An adjacency array is a two-dimension array defined as a[i][j] = {1 if there is an edge (i, j) 0 if there is no edge (i, j) 1.Assuming the graph has n vertices, the time complexity to build such a matrix is O(n^2}. The space complexity is also O(n^2). 2.The advantage of such representation is that we can check in O(1)} time if there exists edge by simply checking the value at i^th row and j^th column of our matrix. 3.to Identifying all edges takes Θ(n2) time.
- Host: GitHub
- URL: https://github.com/arunkumar201/graph_adjacency_matrix
- Owner: arunkumar201
- License: gpl-3.0
- Created: 2021-02-07T10:25:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-07T10:28:26.000Z (over 5 years ago)
- Last Synced: 2025-04-05T07:41:42.468Z (about 1 year ago)
- Language: C
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Graph_Adjacency_Matrix
An adjacency array is a two-dimension array defined as a[i][j] = {1 if there is an edge (i, j) 0 if there is no edge (i, j) 1.Assuming the graph has n vertices, the time complexity to build such a matrix is O(n^2}. The space complexity is also O(n^2). 2.The advantage of such representation is that we can check in O(1)} time if there exists edge by simply checking the value at i^th row and j^th column of our matrix. 3.to Identifying all edges takes Θ(n2) time.