1 parent 30882e0 commit 0c2eaf8Copy full SHA for 0c2eaf8
1 file changed
src/graphs/others/topological-sort.js
@@ -24,6 +24,13 @@
24
result.push(node);
25
}
26
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
+ */
34
return function (graph) {
35
var result = [],
36
visited = [],
0 commit comments