it is giving run time error in some cases and the problem is occuring in insert function in graph class link-https://ide.codingblocks.com/s/110153
Run-time error in some cases
Hello @ritesh2000,
I apologize for replying late. I was not in good health.
The entire logic seems correct.
I think the same that the error is during insertion.
The size your are providing to the adjacency list is not enough for the cases like:
417 86736 13548 90581
where it could be possible that there could be more than n elements in the list of a particular node.
Hope , this would help.
in the declaration of adjacency list i have declared array of list of size of the number of cities. and it should not lead tp overflow as maximum no of vertices is n. and we can push_back any no. of elements in list.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.