I wrote this code to simply read the number of vertices 'n' and edges 'e'. I also read information about the e edges. Each edge is also given a cost. when i run it, it says the error is in line 26. Can some one explain whats the problem ? The code can be found here Thanks in advance. asked 20 Apr '17, 13:21 ![]()
|
Answer is hidden as author is suspended. Click here to view.
answered 20 Apr '17, 14:08 ![]()
Well, yes when I tried it this way (vector<pair> thing), it worked fine. But as can be found here - https://www.topcoder.com/community/data-science/data-science-tutorials/power-up-c-with-the-standard-template-library-part-2/#dijkstra1 ... vector<vector<pair<>>> will also work. I might have implemented it wrong and i wanted to know where.
(20 Apr '17, 16:21)
okay you got it the way i did . that's good . as far as getting it done by the way you are trying , iterator has to be for vp not for vvp . and then access the whole vector inside vvp in a separate vp and the iterate with the iterator in the way you did . But why do so much when an easier way is available . Cheers
(20 Apr '17, 19:58)
|
How to ask questions? Don't have karma. What to do? answered 20 Apr '17, 18:29 ![]()
@stevegeek123 You have to involve yourself in discussions. Answer questions. If your answers are right enough, people vote your answer. Once you get votes, you automatically get karma.
(20 Apr '17, 18:39)
@chari407, thanks for the up vote. I'll try my best.
(20 Apr '17, 18:42)
|