How to write a recursive function that returns a linked list of nodes, when given a binary tree of n
- by Jian Lin
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?