We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f0b789 commit c918ee0Copy full SHA for c918ee0
lib/Graph/dijkstra.cpp
@@ -1,11 +1,9 @@
1
#include "template.h"
2
3
struct Edge {
4
- int cost, to;
5
- Edge(int t, int c) {
6
- cost = c;
7
- to = t;
8
- }
+ int to, cost;
+ Edge(int to, int cost) : to(to), cost(cost) {}
+
9
bool operator<(const Edge &e) const { return cost < e.cost; }
10
bool operator>(const Edge &e) const { return cost > e.cost; }
11
};
0 commit comments