Exemplo n.º 1
0
 public override string ToString()
 {
     if (Droite == null && Gauche == null)
     {
         return("" + Élément);
     }
     else
     {
         return((Gauche?.ToString() ?? "n")
                + " " + (Droite?.ToString() ?? "n")
                + " " + Élément + " |");
     }
 }
Exemplo n.º 2
0
        public static void Afficher <T>(int indice, ArbreBin <T, T> .Noeud?arbre)
            where T : notnull, IComparable <T>
        {
            Indice = indice;

            // Méthodes et propriétés nodales
            if (arbre != null && MenuArbres.StatLevels.Contains(1))
            {
                var aff = false;
                aff |= Afficher("Espèce(racine)", () => arbre.Espèce);
                aff |= Afficher("ToString(racine)", () => arbre.ToString());
                if (arbre.Droite != null)
                {
                    aff |= Afficher("ToString(racine.Droite)", () => arbre.Droite.ToString());
                }
                if (aff)
                {
                    WriteLine();
                }
            }

            if (MenuArbres.StatLevels.Contains(2))
            {
                AfficherStats2(arbre);
            }
            if (MenuArbres.StatLevels.Contains(3))
            {
                AfficherStats3(arbre);
            }
            if (MenuArbres.StatLevels.Contains(4))
            {
                AfficherStats4(arbre);
            }
            if (MenuArbres.StatLevels.Contains(5))
            {
                AfficherStats5(arbre);
            }
            if (MenuArbres.StatLevels.Contains(6))
            {
                AfficherStats6(arbre);
            }
        }
Exemplo n.º 3
0
 Format(ArbreBin <T> ab)
 {
     return(ab?.ToString() ?? "n");
 }