Graph representation using Adjacency Matrix and Adjacency List | Data Structure

preview_player
Показать описание
Contact Datils (You can follow me at)

Watch Complete Playlists:

In this video, I have discussed how we can represent and store a graph in computer's memory. I have also analyzed the time and space complexities of such a representation.
There are two common ways to represent Graph
Adjacency Matrix
Adjacency List

Adjacency Matrix:
Adjacency Matrix is 2-Dimensional Array which has the size VxV, where V are the number of vertices in the graph.
adjMatrix[i][j] = 1 when there is edge between Vertex i and Vertex j, else 0.
It’s easy to implement because removing and adding an edge takes only O(1) time.
But the drawback is that it takes O(V^2) space even though there are very less edges in the graph.
Adjacency List:
Adjacency List is the Array[] of Linked List, where array size is same as number of Vertices in the graph. Every Vertex has a Linked List. Each Node in this Linked list represents the reference to the other vertices which share an edge with the current vertex. The weights can also be stored in the Linked List Node.

what is graph,graph data structure,adjacency matrix,graph representation,adjacency matrix in data structure,graph implementation in c,adjacency list representation of graph in c,tree and graph,introduction to graphs,graph terminology in data structure,types of graph in data structure,ugc net computer science preparation,data structures,arrays,lists,stacks,queues,trees,graphs,primitive,non primitive,linear,non linear,linked lists,ds fundamentals,ds , programming interview question,coding interview question,programming tutorials,computer science,gate,information technology,tutorials,graph algorithm,graph representation,representation of graph using adjacency matrix and adjacency list,adjacency matrix,adjacency list,adjacency matrix vs adjacency list,when to use adjacency matrix,when to use adjacency list,how to represent a graph,directed graph,undirected graph , graph,graph representation,incidence,incidence list,graphs c++,graph implementation,data structures,graphs representation using incidence list,incidence list implementation,incidence list code,incidence matrix,graphs representation using incidence matrix,incidence matrix implementation,incidence matrix code basics,nodes,interview,placements,cse,edge,connection,leaf node,internal,depth,height,level,path,degree,root node,graph terminology,graps,weighted graph,cyclic graph,directed graph,vertices,edges,undirected,acyclic,unweighted,types of graps,kinds of graphs,graph representation,data structure,data structure in hindi,graph in data structure,data structure videos,data structure tutorials, video lectures of data structure, video lectures in hindi on graph
Рекомендации по теме
Комментарии
Автор

Thankuu Soo much sir very well explained...

hope_of_light
Автор

brilliant teacher i have ever seen, Sir you make concept crystal clear

mohdkaif
Автор

Please answer mee kal semester hee mere ... please help me...

BhabaniShankarsahuIlovemymaaan
Автор

Sir help mee
Kya app muje esi ka long question ki ans de sote hee agg
Esi lo bodle money payment karunga app ko

BhabaniShankarsahuIlovemymaaan
Автор

Sir long question ki answer chhahye agg hii agg please answer mee 🙋🙋
Kal exam hai mera .. please

BhabaniShankarsahuIlovemymaaan
Автор

Sir app ka 50 + sucraber vi increase kor dugi please reply mee

BhabaniShankarsahuIlovemymaaan