Leetcode: https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/description/
Slving this question using,
-
Floyd Warshall will have TC= O(v3) , my solution: https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/solutions/5126444/beats-99-floyd-warshall
-
Dijkstra will have TC=O(velog(v)) , my solution: https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/solutions/5126511/dijkstra
where, v= no of vertices
e= no of edges
**So why LEETCODE IS SHOWING HIGHER RUNTIME FOR DIJKSTRA ? **
Chitransh Agrawal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.