graph help!!

Anybody can write me this programme? Unfortunatelly I cannot solve it:
"Write a program that reads in an adjacency list (unordered) from a file ( barabasi.in) of a simple undirected graph.
We can assume there are less then 1000 nodes and 10000 edges.
The output should be the second neighbours of the 0 indexed node. (one in each line)
A solution for example is 'barabasi.out'"
Thanks
Anybody can write me this programme?

No. The purpose of homework is that you learn by doing. We can help with specific questions, but you have to do the effort first to create them.

Ask yourself, what data you need in order to produce the result and what data you have in the input?

How about std::vector<std::set<size_t>>
Last edited on
Topic archived. No new replies allowed.