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.
Building adjacency matrix first and converting it to adjacency list can be significantly faster than directly building lists/sets of edges belonging to vertices. That's because of stupid pattern in test data that turns this exercise into optimization task. Maybe you can even skip those fast scanners avoiding java.util.Scanner.
Dijkstra: Shortest Reach 2
You are viewing a single comment's thread. Return to all comments →
Building adjacency matrix first and converting it to adjacency list can be significantly faster than directly building lists/sets of edges belonging to vertices. That's because of stupid pattern in test data that turns this exercise into optimization task. Maybe you can even skip those fast scanners avoiding java.util.Scanner.