***************dijkstras algo

in this algo after finalizing the shortest distance thw pair is erased from the set but when we r brinting the distances v r iterating over the unordered map of dist but where are v inserting the updated pair in dist??

There is not need to remove and insert in distance map, it gets updated when distance to reach that node reduces. At the end , the distance map will anyhow store the minimum distances.
Watch the lecture video again. It will then be more clear.

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.