Skip to content

Instantly share code, notes, and snippets.

@Florencia-97
Created October 23, 2016 13:59
Show Gist options
  • Save Florencia-97/eb15e7e77c2725f4b47c7e7e408a34dd to your computer and use it in GitHub Desktop.
Save Florencia-97/eb15e7e77c2725f4b47c7e7e408a34dd to your computer and use it in GitHub Desktop.
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