Skip to content

Commit

Permalink
Merge pull request #2033 from DeathRaven1051/master
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
fineanmol authored Oct 3, 2022
2 parents 9ff1499 + f08b18f commit b9ec0dd
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions linked_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Node:
def __init__(self, dataval=None):
self.dataval = dataval
self.nextval = None

class SLinkedList:
def __init__(self):
self.headval = None

def listprint(self):
printval = self.headval
while printval is not None:
print (printval.dataval)
printval = printval.nextval

list = SLinkedList()
list.headval = Node("Monday")
e2 = Node("Tuesday")
e3 = Node("Wednesday")

list.headval.nextval = e2

e2.nextval = e3

list.listprint()

0 comments on commit b9ec0dd

Please sign in to comment.