How to write a recursive function that returns a linked list of nodes, when given a binary tree of n

Posted by Jian Lin on Stack Overflow See other posts from Stack Overflow or by Jian Lin
Published on 2010-03-31T22:43:35Z Indexed on 2010/03/31 22:53 UTC
Read the original article Hit count: 371

I was once asked of this in an interview:

How to write a recursive function that returns a linked list of nodes, when given a binary tree of nodes? (flattening the data)

For some reason, I tend to need more than 3 to 5 minutes to solve any recursive problem. Usually, 15 to 20 minutes will be more like it. How could we attack this problem, such as a very systematic way of reaching a solution, so that they can be solved in 3 to 5 minute time frame?

© Stack Overflow or respective owner

Related posts about recursion

Related posts about interview-questions