There's more...
There is a massive amount of computer science literature on the topic of trees and data structures; if you want to read more, Wikipedia provides a great introduction at http://en.wikipedia.org/wiki/Tree_%28data_structure%29.
Note that the use of lambda functions and map is not encouraged as a Python dialect; you can read some (old) opinions on the subject from Guido van Rossum at http://www.artima.com/weblogs/viewpost.jsp?thread=98196. I presented it here because it's a very common dialect with functional and recursive programming. The more common dialect will be based on a list comprehensions.
In any case, the functional dialect based on using map and reduce is the conceptual base for MapReduce frameworks, and you can use ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access