This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| class Pilha(): | |
| def __init__(self): | |
| self.lista = [] | |
| def empilhar(self, valor): | |
| self.lista.append(valor) | |
| def vazia(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ListaVaziaErro(Exception): | |
| pass | |
| class Noh(): | |
| def __init__(self, valor, esquerdo = None, direito = None): | |
| self.valor = valor | |
| self.direito = direito | |
| self.esquerdo = esquerdo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| def max_min(x): | |
| ''' | |
| :param seq: uma sequencia | |
| :return: (min, max) | |
| Entra com uma lista X, ele retorna o Maior numero e o Menor; Tempo em O(n). | |
| ''' |
NewerOlder