From 8f9225ec62b25270bb3cfdebdce7593439a2043d Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Wed, 11 Feb 2026 15:11:14 -0800 Subject: [PATCH] Update full linked list example --- .../2026.01.28/full_linked_list.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/shared/notes-and-examples/2026.01.28/full_linked_list.py b/shared/notes-and-examples/2026.01.28/full_linked_list.py index a05a729..dbc7c0e 100644 --- a/shared/notes-and-examples/2026.01.28/full_linked_list.py +++ b/shared/notes-and-examples/2026.01.28/full_linked_list.py @@ -14,19 +14,19 @@ class LinkedList: head = None tail = None -def append(Llist, thing): - if Llist.head==None: - Llist.head=Node(value=thing) - Llist.tail=Llist.head - return - Llist.tail.nextNode=Node(value=thing) - Llist.tail=Llist.tail.nextNode + def append(self, thing): + if self.head==None: + self.head=Node(value=thing) + self.tail=self.head + return + self.tail.nextNode=Node(value=thing) + self.tail=self.tail.nextNode list1=LinkedList() -append(list1, 'hi') -append(list1, 'hi again') -append(list1, 'why am I saying hi so many times?') +list1.append('hi') +list1.append('hi again') +list1.append('why am I saying hi so many times?') print(list1.head.value) print(list1.head.nextNode.value) print(list1.head.nextNode.nextNode.value)