Länk - A very simple tree implementation in python

published Apr 24, 2012 01:29   by admin ( last modified Apr 24, 2012 01:29 )

 

Using Python's built-in defaultdict we can easily define a tree data structure: def tree(): return defaultdict(tree)



Read more: one-line tree in python — Gist