Dijkstra, Leetcode Medium, Graph, Cpp.
Present node=0. Check all connected nodes of present node. ie if you are sitting on Node what other nodes you can see and at what distance? Update cost. cost | 0 | 10 | inf | 50 | 0 1 2 3 visited |1|0|0|0| Step-4. Move to least cost neighbour of present node. if present node=0, least cost