Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2020 14:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vamsitallapudi/d6cdc37f82f154558ca4b6909215a80d to your computer and use it in GitHub Desktop.
class Node:
def __init__(self, data): = data # assigning the data passed = None # initializing the node as null
class LinkedList:
def __init__(self):
self.head = None
def traverse(self):
node = self.head
while node is not None:
node =
# actual code execution starts from here
if __name__ == '__main__':
linkedList = LinkedList()
linkedList.head = Node('a')
second = Node('b')
third = Node('c') = second = third
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment