Digraph.java (source code)

= Digraph.java
{c}

Online text: https://raw.githubusercontent.com/kevin-wayne/algs4/master/src/main/java/edu/princeton/cs/algs4/Digraph.java

Authored accompanying software by Robert Sedgewick and Kevin Wayne, identified by the implementation bylines. The book publication year is 2011; copyright 2002–2025 is not an implementation publication date. Implementation locators refer to the inspected source file, not to the textbook pages.

Cited passages: Digraph.java, addEdge, adj and outdegree: one entry in the tail's collection; indegree is maintained separately; Digraph.java, class documentation and addEdge: parallel edges permitted; a directed self-loop adds one outgoing entry and increments indegree once; Digraph.java, class documentation and adj: obtaining the collection versus iterating in time proportional to outdegree.