# https://en.wikipedia.org/wiki/Binary_tree

from blist import sorteddict

# create new b-tree
b_tree = sorteddict(first="Michael", last="Sjoeberg", birthday=[1750, 1, 1])
b_tree                  # sorteddict({'birthday': [1750, 1, 1], 'first': 'Michael', 'last': 'Sjoeberg'})

# add key=value
b_tree['email'] = "[email protected]"
b_tree                  # sorteddict({'birthday': [1750, 1, 1], 'email': '[email protected]', 'first': 'Michael', 'last': 'Sjoeberg'})

# list keys
list(b_tree.keys())     # ['birthday', 'email', 'first', 'last']

'''
Michael Sjoeberg
2018-11-05
https://github.com/michaelsjoeberg/python-playground/blob/master/data-science/binary-trees.py
'''