Skip to content

Commit 4b96cd9

Browse files
williamfisetclaude
andcommitted
Add note linking to Kahn's algorithm in TopologicalSortAdjacencyList
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 10f2934 commit 4b96cd9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/williamfiset/algorithms/graphtheory/TopologicalSortAdjacencyList.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*
66
* <p>Also includes a method to find shortest paths in a DAG using the topological ordering.
77
*
8+
* <p>NOTE: An arguably simpler approach to topological sorting is Kahn's algorithm, which uses
9+
* in-degree counting and BFS instead of DFS. See {@link Kahns}.
10+
*
811
* <p>Time: O(V + E)
912
*
1013
* <p>Space: O(V + E)

0 commit comments

Comments
 (0)