Dijkstra's Algorithm For Single Source Shortest path

I implemented the code but the answer is coming out to be incorrect. Please help me.

LINK : https://ide.codingblocks.com/s/345793

hello @gptradhika1208

checking . . . . . . .

@gptradhika1208
image

here this loop will never run because dist is empty.
u need to iterate through each vertices of graph and then mark its ditance as INT_MAX

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.