Skip to content

Instantly share code, notes, and snippets.

View ThomasRoca's full-sized avatar

@Thomas_Roca ThomasRoca

  • Microsoft Corp
  • Seattle
  • 23:13 (UTC -12:00)
View GitHub Profile
@ThomasRoca
ThomasRoca / tree.md
Created December 15, 2015 03:18 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

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

def tree(): return defaultdict(tree)

That's it!