U are given the data(startnode,end node,cost) for each edge on a separate line but u dont no how much nodes u hav b4 hand how u declare it? how do u link the nodes in an adjacency list using linked list and not d <vector>?
TriniBabe
0
Newbie Poster
Recommended Answers
Jump to PostHeh, sorry but I'm about as useful as a hobo when it comes to graphs, as for linked lists, the basic format is:
struct list { int data; list *link; };
basically you create a list *a and link it to another list variable with *link inside …
Jump to PostWell there is really nothing stopping you, although it might get confusing to access individual elements at times. Just remeber that you use -> instead of . to access variables in your list(sorry, my example was wrong >_<, but I edited it).
All 7 Replies
TriniBabe
0
Newbie Poster
SeeTheLite
20
Junior Poster
TriniBabe
0
Newbie Poster
SeeTheLite
20
Junior Poster
TriniBabe
0
Newbie Poster
SeeTheLite
20
Junior Poster
DemonGal711
8
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.