IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Voir le flux RSS

Messages des blogs récents

  1. Python. Parcours préfixe, infixe et postfixe d'un arbre binaire contenu dans un dictionnaire.

    par , 17/05/2020 à 22h30
    Code Python : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    ...

    Mis à jour 24/05/2020 à 20h28 par danielhagnoul

    Catégories
    Python , Python , Programmation