Graph Data Structure
Definition
Graph node for a directed graph
Graph node for an undirected graph
We can use the same graph node for an undirected graph. But when adding an edge, we have to add it in both directions since it is bidirectional.
Last updated