MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / SinglyLinkedList

Class SinglyLinkedList

Hackerrank_problems/Cycle Detection/solution.py:14–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 self.next = None
13
14class SinglyLinkedList:
15 def __init__(self):
16 self.head = None
17 self.tail = None
18
19 def insert_node(self, node_data):
20 node = SinglyLinkedListNode(node_data)
21
22 if not self.head:
23 self.head = node
24 else:
25 self.tail.next = node
26
27
28 self.tail = node
29
30def print_singly_linked_list(node, sep, fptr):
31 while node:

Callers 1

solution.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected