arnodel at googlemail.com
Mon May 4 23:31:29 CEST 2009
bearophileHUGS at lycos.com writes:
>> When have you ever had a binary tree a thousand levels deep?
>>Consider how big 2**1000 is...<
> You are thinking just about complete binary trees.
> But consider that a topology like a single linked list (every node has
> 1 child, and they are chained) is a true binary tree still.
In that case the following would not grow the stack, given tail-call
print 'visiting', node
if node.right is None:
if node.left is not None:
More information about the Python-list