12 Jun
2007
12 Jun
'07
4:05 p.m.
On 6/12/07, Kevin Piche <kevin.piche@cgi.com> wrote:
Cool. From my point of view I could argue that the recursive algorithm would be more expressive and obvious because I find tree/DAG recursive functions more natural. However from an efficiency standpoint a topological sort is a simple (breadth first) postfix tree traversal O(n) whereas your algorithm is at least O(N^2). But it's better than the previous algo. :)
k
By the way, this landed in the main tree here: http://projects.archlinux.org/git/?p=pacman.git;a=commitdiff;h=544bcbe6641bb... We'll always take rewrites to make it more efficient. :P -Dan