Talk:Topological sort/Extracted top item: Difference between revisions

Line 13:
::::: Ok, I have finally noticed the line in the python display which reads: "The top levels of the dependency graph are: top2 top1". But please note that the current task description does not ask for this to be displayed, and (I do represent this information internally, in the J implementation). Also, as near as I can tell, identification of the top levels is completely independent from displaying the compile order (it will be the same regardless of which files we are compiling). That said, if you are willing to update the task to ask that this be displayed, I will update my J implementation to display it. --[[User:Rdm|Rdm]] 16:12, 14 October 2010 (UTC)
:::::: Specifically: the top levels are identified by <code>(+./<+./"1)depends</code> after depends gets calculated and before the while loop where I destroy it. And the names of the top levels would be <code>names#~(+./<+./"1)depends</code>, and I could format and display them. However, with my current implementation, this would get displayed every time I asked for a compile order (so it would be repeated 3 times for the three current examples). --[[User:Rdm|Rdm]] 16:29, 14 October 2010 (UTC)
 
Hi Rdm. The description includes this definition of what makes a top level:
:A top level file is defined as a file that:
:# Has dependents.
:# Is not itself the dependent of another file
 
And also item one of the task description asks for a routine that can calculate all top levels for a given set of dependencies:
:The task is to create a program that given a graph of the dependency:
:# Determines the top levels
 
I could change this to read determine ''and show'' the top levels if this would be more clear. Determining the top levels is a useful function in practice as top levels can be 'forgotten' in documentation if they are not primary, but may still remain useful. --[[User:Paddy3118|Paddy3118]] 21:49, 14 October 2010 (UTC)
Anonymous user