Talk:Dijkstra's algorithm: Difference between revisions

Content deleted Content added
No edit summary
Line 50:
 
This...doesn't make it easier. It actually sounds incredibly patronizing. Who in the right mind would try to learn Dijkstra's algorithm without knowing what a vertex is? [[Special:Contributions/2001:569:57B2:4D00:71E1:A843:C41:841C|2001:569:57B2:4D00:71E1:A843:C41:841C]] ([[User talk:2001:569:57B2:4D00:71E1:A843:C41:841C|talk]]) 16:22, 25 May 2022 (UTC)
 
== Pseudocode improvement ==
 
In first pseudocode block, on line 15, dist[u] is checked for not being INFINITY. But if it is INFINITY at this point, the code will continue useless looping, because all remaining vertices will also have dist[u]=INFINITY and not influence the result. Maybe move the INFINITY check to line 11 and break out of while block, it would be more human readable too I think