Skip to content

Commit 0c2eaf8

Browse files
committed
Update topological sort docs
1 parent 30882e0 commit 0c2eaf8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/graphs/others/topological-sort.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
result.push(node);
2525
}
2626

27+
/**
28+
* Implements the topological sort algorithm.
29+
*
30+
* @public
31+
* @param {object} graph A graph represented with list of neighbors
32+
* @return {array} The list containing all nodes in topological sorted order
33+
*/
2734
return function (graph) {
2835
var result = [],
2936
visited = [],

0 commit comments

Comments
 (0)