diff --git a/Linked_List/main.py b/Linked_List/main.py index b0ba0a5..e8820d2 100644 --- a/Linked_List/main.py +++ b/Linked_List/main.py @@ -1,9 +1,10 @@ - +# Each node contains a 'data' and link to the 'next' node class node: def __init__(self,data=None): self.data=data self.next=None +# linked_list contains the nodes that we created above. class linked_list: def __init__(self): self.head=node() @@ -127,4 +128,4 @@ def set(self,index,data): if cur_idx==index: cur_node.data=data return - cur_idx+=1 \ No newline at end of file + cur_idx+=1