Skip to content

Commit 4cd729f

Browse files
committed
Added Topological Sort algorithm with DFS implementation and Javadoc comments
1 parent e050e09 commit 4cd729f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/com/thealgorithms/graphsearch/TopologicalSort.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
*/
1212

1313
public class TopologicalSort {
14+
15+
// Private constructor to prevent instantiation
16+
private TopologicalSort(){
17+
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
18+
}
1419
/**
1520
* Main method to test the Topological Sort implementation.
1621
* Creates a sample graph and prints its topological ordering.

0 commit comments

Comments
 (0)