Skip to content

Commit 76db6c3

Browse files
committed
Update 2015-1-11-topsort.md
add more description
1 parent 7b548e5 commit 76db6c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

_posts/2015-1-11-topsort.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ tags: [algorithm, maizi]
88

99
提供一个topsort coffeescript的实现,由于课程时间所限topsort没有放在课里讲,对有向图节点排序有兴趣的同学可以自学一下。
1010

11+
下面的代码是使用DFS的topsort算法,具体算法描述可以看[Topological sort wikipedia](http://en.wikipedia.org/wiki/Topological_sorting)
1112

1213

1314
{% highlight coffeescript %}
15+
class Graph
1416
# topological sort
1517
top_sort:()->
1618
result = [] #sort result
@@ -42,3 +44,4 @@ tags: [algorithm, maizi]
4244
return result
4345

4446
{% endhighlight %}
47+

0 commit comments

Comments
 (0)