Graph using adjacency list


Can anyone tell me how to code a graph using adjacency list as I am new to programming.

Thanks in advance.

use a hash map, the node is the key, adjacent nodes are map entries.

For every node i have a text file that stores the nodes which are connected to it.I have generated the linked list for every node but I want to store it in array of strings so that it forms the adjacency list.

Moreover my nodes are not numbers but strings(i.e they store the sting data like red,blue,yellow etc.)

I don't know how to use the hash tables.Can you provide some example to illustrate your point? I will be really grateful to you.

Topic archived. No new replies allowed.