Which list? That vector may contain any number of lists. If you know how to iterate a vector, then there is nothing new for you here. Each element of the vector will be a list that you can operate on as you like.
The list from the 2nd while loop. The vector contains 5 lists one for each vertex for the graph. I can iterate the vector but every time I try to access the pairs in the list I get a segmentation core dump error. I guess my question more specifically would be how to access the pairs in the list from the vector?
This is what I had :
1 2 3 4 5 6 7 8 9
for (int i = 0; i < adjlist.size(); i++) {
list< pair<int, float> >::iterator itr = adjlist[i].begin();
while (itr != adjlist[i].end()) {
cout<<(*itr).first<<" "<< (*itr).second<<endl;
itr++;
}