Jump to content

Topological sort: Difference between revisions

Fixed jq example - minus function didn't work.
(Better cycle detection for rust solution)
(Fixed jq example - minus function didn't work.)
Line 3,087:
# Input: an object representing a dependency graph
def minus(ary):
. as $G | reduce keys[] as $key with_entries($G; $G[$key].value -= ary);
 
# tsort/0 emits the topologically sorted nodes of the input,
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.