Getting seg fault
Check now
is it possible to know the reason why I’m getting seg fault? because the algorithm seems correct to me.
By using vector , you were iterating over the index which didn’t existed in your map , also while inserting pair in set, you have to pair like dist and then node, so that it can sort on the basis of distance and not of the node.
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.