How is Python designed?

Diez B. Roggisch deetsNOSPAM at web.de
Wed Dec 8 11:31:33 EST 2004


> I'm sure the code in my example is recursive. As I
> have said, you may show those codes I gave as example
> to somebody know C++ well to check if it is recursive.

I just had second thoughts about tree-traversal beeing recursive - and I
have to admit that I'm not entirely sure if I can hold up the statement
that it's not recursive. It might be counted as that, as the strategy of
traversing a tree certainly is of a recursive nature, as its styled
somewhat like this:

def treewalk(node):
    for child in node.childs:
        treewalk(child)
    node.do_something()

So maybe you're right in claiming it beeing recursive. But then,
depth-traversal is recursive, too.

Now apart from that, I still fail to see where your method of evaluation has
any speed gains. 

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list