Returns a topologically sorted array of nodes. The array is sorted from children to parents, i.e. the first element has no child and the last node has no parent.
If there is a cycle, TSort::Cyclic is raised.
Source Code
# File tsort.rb, line 134 def tsort result = [] tsort_each {|element| result << element} result end
<code/>and<pre/>for code samples.