Graphs - data structures

Hey, I have been reading about graphs and trees. I have read the different types of trees such as; AVL/ red/black and splay trees etc.

However, I'm just not getting graphs? How would I go about writing an un-weighted graph? Should an adjacency matrix/ list be used? How would I go about implementing this. Should it be able to add a new node? or add an edge?

Could someone show me an example code to write an un-weighted graph using adjacency?

Thankyou in advance
The data structure is relatively simple:
1
2
3
4
5
6
struct binary_tree_node
{
  ... m_Data;
  binary_tree_node *m_Left;
  binary_tree_node *m_Right;
};


You need the data and the appropriate number of pointer to the branches
Topic archived. No new replies allowed.