We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
its ok ...but here nodes<=3000 then using adjacency matrix and simple naive searching for min weight node gives the time complexity O(nodes^2) which means max to max 9000000 iterations and this should work absolutely fine(<=1second).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Dijkstra: Shortest Reach 2
You are viewing a single comment's thread. Return to all comments →
its ok ...but here nodes<=3000 then using adjacency matrix and simple naive searching for min weight node gives the time complexity O(nodes^2) which means max to max 9000000 iterations and this should work absolutely fine(<=1second).