# SICP Solutions

### Section - 2.2 - Hierarchical Data and the Closure Property

#### Exercise 2.20

Note that we need to reverse the list in end to get the required result.

Here is another implementation which will not require reversing the list:

Note that in first implementation collect is iterative but in latter it is recursive.