From dd4f100bfa29ef927d7cf12cf24074d6ee29b39a Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 19 Apr 2017 23:10:08 -0300 Subject: [PATCH] =?UTF-8?q?Exerc=C3=ADcio=20de=20=C3=A1rvore,=20enunciado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exercicios/arvore.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 exercicios/arvore.py diff --git a/exercicios/arvore.py b/exercicios/arvore.py new file mode 100644 index 0000000..c7dbf14 --- /dev/null +++ b/exercicios/arvore.py @@ -0,0 +1,22 @@ +class Arvore: + ''' + >>> for noh in Arvore(0, Arvore(-2, Arvore(-4), Arvore(-3)), Arvore( + 10)): + ... print(noh) + -4 + -1 + -2 + 0 + 10 + + ''' + + def __init__(self, valor, esquerda=None, direita=None): + self.esquerda = esquerda + self.direita = direita + + + + # 0 + # -2 10 + # -4 -1