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

listes-liees-boucle.py

Blame
  • listes-liees-boucle.py 283 B
    from LinkedList import *
    
    ll = LinkedList() # 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 ! ")