We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c45313e commit 851140fCopy full SHA for 851140f
1 file changed
DSA/single_linkedlist.py
@@ -17,11 +17,11 @@ def tranversal(self):
17
print(a.data,end=" ")
18
a=a.next
19
20
-n1=Node(5)
21
-sll=Sll()
22
-sll.head=n1
23
-n2=Node(10)
24
-n1.next=n2
+n1=Node(5) # create a data=5 and pass value in Node class
+sll=Sll() # create a object of sll
+sll.head=n1 # now assign a n1 object to sll.head variable now sll.head=5
+n2=Node(10) # and create another data=10 node and pass value in Node class
+n1.next=n2 # now connect the two nodes
25
n3=Node(15)
26
n2.next=n3
27
n4=Node(20)
0 commit comments