append method linked list python

Solutions on MaxInterview for append method linked list python by the best coders in the world

showing results for - "append method linked list python"
Margaux
05 Jan 2020
1def append(self,item):
2    current = self.head
3    if current:
4        while current.getNext() != None:
5            current = current.getNext()
6        current.setNext(Node(item))
7    else:
8        self.head = Node(item)