filmov
tv
Graph representation using Adjacency Matrix and Adjacency List | Data Structure
![preview_player](https://i.ytimg.com/vi/Gs_YMksyM_k/maxresdefault.jpg)
Показать описание
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
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
Комментарии