Skip to content
Snippets Groups Projects
Select Git revision
  • 4527a199d3cc7ab06c93efa711b8e7e6f75f0d68
  • master default protected
2 results

listes-liee-boucle.py

Blame
  • user avatar
    Romain Vuillemot authored
    b43cb569
    History
    listes-liee-boucle.py 283 B
    from liste_liee import *
    
    ll = liste_liee() # Ajout de données
    ll.push(20) 
    ll.push(4) 
    ll.push(15) 
    ll.push(10)
       
    # Création d'une boucle
    ll.head.next.next.next.next = ll.head; 
      
    if( ll.detectLoop()): 
        print ("Il y a une boucle !") 
    else : 
        print ("Pas de boucle ! ")