On 05/08/2010 10:33 PM, 3Jane wrote:
You could interpret [[1,2,3,4],[5,6,7,8]] as a tree and
your task as traversal of its leaves. All solutions before
would not work with trees with bigger height.
Here is how to traverse such trees recursively:
def eventualPrint(x):
for v in x:
i
You could interpret [[1,2,3,4],[5,6,7,8]] as a tree and
your task as traversal of its leaves. All solutions before
would not work with trees with bigger height.
Here is how to traverse such trees recursively:
def eventualPrint(x):
for v in x:
if isinstance(v, list): eventualPrint(x)