...

/

Solution Review: Tree to List Conversion using Recursion

Solution Review: Tree to List Conversion using Recursion

Let’s take a detailed look at the previous challenge’s solution.

Solution

The tree to the list conversion is done recursively. At each node, we must assume that the treeToListRec() function will do its job for the left child and right child. Then we combine the result of the left child and right child traversal. We need a head and ...