Package algs44
Class DirectedEdge
java.lang.Object
algs44.DirectedEdge
- All Implemented Interfaces:
Comparable<DirectedEdge>
The
DirectedEdge
class represents a weighted edge in an directed graph.
For additional documentation, see Section 4.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDirectedEdge
(int v, int w, double weight) Create a directed edge from v to w with given weight. -
Method Summary
-
Field Details
-
v
-
w
-
weight
-
-
Constructor Details
-
DirectedEdge
Create a directed edge from v to w with given weight.
-
-
Method Details
-
from
Return the vertex where this edge begins. -
to
Return the vertex where this edge ends. -
weight
Return the weight of this edge. -
toString
Return a string representation of this edge. -
compareTo
Compare by weights.- Specified by:
compareTo
in interfaceComparable<DirectedEdge>
-
main
Test client.
-