Changeset 30532 in osm for applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java
- Timestamp:
- 2014-07-14T04:18:06+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java
r28116 r30532 21 21 * <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. 22 22 */ 23 24 25 26 23 public class EdgeWeightedDigraph { 27 24 private final int V; … … 32 29 * Create an empty edge-weighted digraph with V vertices. 33 30 */ 31 @SuppressWarnings("unchecked") 34 32 public EdgeWeightedDigraph(int V) { 35 33 if (V < 0) throw new RuntimeException("Number of vertices must be nonnegative"); … … 102 100 } 103 101 104 105 102 /** 106 103 * Add the edge e to this digraph. … … 111 108 E++; 112 109 } 113 114 110 115 111 /** … … 144 140 } 145 141 146 147 148 142 /** 149 143 * Return a string representation of this graph. … … 162 156 return s.toString(); 163 157 } 164 165 /**166 * Test client.167 */168 // public static void main(String[] args) {169 // In in = new In(args[0]);170 // EdgeWeightedDigraph G = new EdgeWeightedDigraph(in);171 // StdOut.println(G);172 // }173 174 158 }
Note:
See TracChangeset
for help on using the changeset viewer.