1.node and edges wala hota hai graph
2.types
1.undirected
2.directed
3.node → entity hai to store data
4.edge → connecting nodes
5.degree: degree(v) → v node se kitne connection hai
6.weighted graph
7.Graph
|→adjacency matrix
|→adjacency list
1.adjacency matrlix:
2.adjancecy list
map<int,list<int>>
8.code
class graph{
public:
unordered_map<int,list<int>>adj;
void addEdge(int u, inty, bool direction){
adj[u].push_back(v);
if(direction == 0){
adj[v].push_back(u)
}
}
}