Package algs44

Class DirectedEdge

java.lang.Object
algs44.DirectedEdge
All Implemented Interfaces:
Comparable<DirectedEdge>

public class DirectedEdge extends Object implements 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.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DirectedEdge(int v, int w, double weight)
    Create a directed edge from v to w with given weight.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compare by weights.
    int
    Return the vertex where this edge begins.
    static void
    main(String[] args)
    Test client.
    int
    to()
    Return the vertex where this edge ends.
    Return a string representation of this edge.
    double
    Return the weight of this edge.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DirectedEdge

      public DirectedEdge(int v, int w, double weight)
      Create a directed edge from v to w with given weight.
  • Method Details