Topological sort: Difference between revisions

m
(→‎{{header|Java}}: adjacency entries are only 1 or 0, so are booleans)
Line 4,703:
<lang zkl>fcn topoSort(data){ // data is L( L(root,L(leaves)),...)
allDs:=data.pump(List,fcn(rds){ T(Void.Write,Void.Write,rds[1]) }).copy();
roots:=DDictionary(data); // dictionary of root:leaves
L:=List();
S:=data.pump(List,'wrap([(r,_)]){ if(allDs.holds(r)) Void.Skip else r }).copy();
Anonymous user