Update graph.md

pull/427/head
Eshparsi 2024-05-19 12:24:13 +05:30 zatwierdzone przez GitHub
rodzic 0db9cef68c
commit 05071b5087
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -32,7 +32,7 @@ Graph is a non-linear data structure consisting of vertices and edges. It is a p
## Representation of Graphs
There are two ways to store a graph:
1. **Adjacency Matrix**
1. **Adjacency Matrix:**
In this method, the graph is stored in the form of the 2D matrix where rows and columns denote vertices. Each entry in the matrix represents the weight of the edge between those vertices.
```python
@ -64,7 +64,7 @@ for row in adj_matrix:
```
2. **Adjacency List**
2. **Adjacency List:**
In this method, the graph is represented as a collection of linked lists. There is an array of pointer which points to the edges connected to that vertex.
```python