From 05071b50871a74cfa03420c70014f6a6c16d96fd Mon Sep 17 00:00:00 2001 From: Eshparsi <112681516+Eshparsi@users.noreply.github.com> Date: Sun, 19 May 2024 12:24:13 +0530 Subject: [PATCH] Update graph.md --- contrib/Data-Structure-Graphs/graph.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/Data-Structure-Graphs/graph.md b/contrib/Data-Structure-Graphs/graph.md index 9837896..517c90d 100644 --- a/contrib/Data-Structure-Graphs/graph.md +++ b/contrib/Data-Structure-Graphs/graph.md @@ -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