Skip to content

Commit 851140f

Browse files
committed
go through single inked list
1 parent c45313e commit 851140f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

DSA/single_linkedlist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def tranversal(self):
1717
print(a.data,end=" ")
1818
a=a.next
1919

20-
n1=Node(5)
21-
sll=Sll()
22-
sll.head=n1
23-
n2=Node(10)
24-
n1.next=n2
20+
n1=Node(5) # create a data=5 and pass value in Node class
21+
sll=Sll() # create a object of sll
22+
sll.head=n1 # now assign a n1 object to sll.head variable now sll.head=5
23+
n2=Node(10) # and create another data=10 node and pass value in Node class
24+
n1.next=n2 # now connect the two nodes
2525
n3=Node(15)
2626
n2.next=n3
2727
n4=Node(20)

0 commit comments

Comments
 (0)