Created
October 23, 2016 13:59
-
-
Save Florencia-97/eb15e7e77c2725f4b47c7e7e408a34dd to your computer and use it in GitHub Desktop.
This file contains 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 _Nodo: | |
def __init__(self,prim,prox=None): | |
self.prim=prim | |
self.prox=prox | |
class ListaEnlazada: | |
def __init__(self): | |
self.prim=None | |
self.len=0 | |
def append(self,dato): | |
n_nuevo= _Nodo(dato) | |
actual=self.prim | |
if actual==None: | |
self.prim=n_nuevo | |
else: | |
while actual.prox != None: | |
actual=actual.prox | |
actual.prox=n_nuevo | |
self.len +=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment