Link to home
Start Free TrialLog in
Avatar of rmtogether
rmtogether

asked on

linked list (for network graph)

hi,

Is it possible to struck linked at some certain points has more than one continue link?

for example, A network A-->B-->C then C can go both D and E at same time.......something like that

I search linked list examples, they always follow one by one sequence, so is it possible to set some certain situation has multiple path?
If yes, could you give me some sample code

thanks
   
Avatar of sunnycoder
sunnycoder
Flag of India image

Hi rmtogether,

It is possible but the resulting data structure would not technically be a linked list ... also the format/structure of this branchng node could be different from that of other nodes ... What you seem to be looking for here is a directed acyclic graph or DAG
http://en.wikipedia.org/wiki/Directed_acyclic_graph
http://www.nist.gov/dads/HTML/directedGraph.html

Cheers!
sunnycoder
Hi rmtogether,

> (for network graph)
A graph is a much better data structure to use for network graphs ... In case you have one way connections in the network, you can use a directed graph.
http://en.wikipedia.org/wiki/Graph_(data_structure)
http://en.wikipedia.org/wiki/Graph_theory
http://www.nist.gov/dads/HTML/graph.html


Cheers!
sunnycoder
Avatar of rmtogether
rmtogether

ASKER

thanks,

are there any actual program code examples ?
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi,

I am interested in http://www.cs.sunysb.edu/~algorith/files/graph-data-structures.shtml 
how can I find example codes of this problem? thanks in advance
The page has Implementations section near bottom of the page that has links to a few implementations