Category : Miscellaneous Language Source Code
Archive   : SETLSZIP.ZIP
Filename : TOPSORT1.STL

 
Output of file : TOPSORT1.STL contained in archive : SETLSZIP.ZIP
program topsort1;
proc tsort1;
g:= {[1,4],[1,2],[2,4],[3,4],[2,3]};
nodes := domain g + range g;
sorted := tsort1(g,nodes);
print('Sorted list: ',sorted);

procedure tsort1(g,nodes);
$topological sorting procedure, recursive form
return
if exists n in nodes | n notin range g then
[n]+tsort1(g lessf n,nodes less n)
else
[]
end;
end proc;

end prog;



  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : SETLSZIP.ZIP
Filename : TOPSORT1.STL

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/