This commit is contained in:
alstergym
2026-09-24 10:16:57 +02:00
parent 346435da83
commit ec5e42b555
+19
View File
@@ -15,6 +15,25 @@ class liste:
while aktuell.richtung != None:
aktuell = aktuell.richtung
aktuell.setNachfolger(k)
def knoten_einfügen(self,k,stelle):
if stelle==0:
k.setNachfolger(self.head)
self.head = k
else:
aktuell = self.head
i = 0
while aktuell.nf != None:
i = i+1
aktuell = aktuell.Nachfolger
if i == stelle:
k.setNachfolger(aktuell.Nachfolger)
aktuell.setNachfolger(k)