21 21 votes Specify an adjacency-lists representation of the undirected graph given above. Graph Theory gate1987 graph-theory easy graph-connectivity descriptive + – Misbah Ghaya 3.4k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 25 25 votes An adjacency list is an array $A$ of separate lists. Each element of the array $A_{i}$ is a list, which contains all the vertices that are adjacent to vertex $i$. $A_{1}\rightarrow2\rightarrow3\rightarrow5$ $A_{2}\rightarrow1\rightarrow3$ $A_{3}\rightarrow1\rightarrow2\rightarrow4\rightarrow5$ $A_{4}\rightarrow3\rightarrow5$ $A_{5}\rightarrow1\rightarrow3\rightarrow4$ Satbir answered Jun 5, 2019 • edited Apr 15, 2021 by Lakshman Bhaiya Satbir comment Share Follow See all 4 Comments 4 4 Comments reply Pranavpurkar commented Apr 18, 2022 reply Follow flag order doesn’t matter! 4 4 replyShare pavansan commented Jan 2, 2025 reply Follow flag nice explaination 0 0 replyShare Amjad. commented Sep 19, 2025 reply Follow flag Matrix Representation would be : $\left[ \begin{array}{r | cc} & 1 & 2 & 3 & 4 & 5 \\ 1 & 0 & 1 & 1 & 0 & 1 \\ 2 & 1 & 0 & 1 & 0 & 0 \\ 3 & 1 & 1 & 0 & 1 & 1 \\ 4 & 0 & 0 & 1 & 0 & 1 \\ 5 & 1 & 0 & 1 & 1 & 0 \end{array} \right]$ 0 0 replyShare juDson_Abhi commented Apr 25 reply Follow flag RepresentationBest ForAdjacency List -Sparse graphs (less edges)Adajcency Matrix - Dense graphs 0 0 replyShare Please log in or register to add a comment.