Reputation: 5225
I have learned the basics of graph data structures. Now I want to implement all the structure/algorithms/operations that can be performed on graphs.
Please share some useful links wherein I can get started doing graph implementations in C.
Upvotes: 3
Views: 7937
Reputation: 17
The book,The Algorithm Design Manual[PDF] has C code implementing a graph.
For a more thorough textbook on graphs and related algorithms (DFS, Bellman-Ford etc) Introduction to Algorithms (excellent) has pseudocode implementations that you could implement.
The standard adjacency list or matrix representations mentioned by Alex are described in both.
Upvotes: 1
Reputation: 881497
adjacency list and adjacency matrix are the two most classic alternatives for implementing graphs. I'm not sure if there are many examples of each online in C, but here is one for the adjacency matrix representation.
Upvotes: 3