class Liste:
"""une liste chaînée"""
def __init__(self):
self.tete = None
def est_vide(self):
return self.tete is None
def ajoute(self, x):
self.tete = Cellule(x, self.tete)
def __len__(self):
return longueur(self.tete)
def __getitem__(self, n):
return nieme_element(n, self.tete)
def reverse(self):
self.tete = renverser(self.tete)
def __add__(self, lst):
r = Liste()
r.tete = concatener(self.tete, lst.tete)
return r