1 2 3 4 5 6 7 8 9 10 11 12
| #! python3
# coding: utf-8
binary_tree = {'r': ['a', 'b'], 'a': ['c', 'd'], 'b': ['e', 'f'],
'c': ['', 'h'], 'd': ['i', 'j'], 'e': ['k', ''], 'f': ['', ''],
'h': ['', ''], 'i': ['', ''], 'j': ['m', ''], 'k': ['', ''], 'm': ['', '']}
def binary_tree_parcours_prefixe(root_str, T):
""" Parcours prefixe de l'arbre binaire T """
parcours = []
key = root_str |