MCPcopy Index your code
hub / github.com/geekcomputers/Python / add_node

Method add_node

singly_linked_list.py:19–27  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

17 return count
18
19 def add_node(self, data):
20 new_node = Node(data)
21 if self.head is None:
22 self.head = new_node
23 else:
24 curr = self.head
25 while curr.next != None:
26 curr = curr.next
27 curr.next = new_node
28
29 def insert_at_head(self, data):
30 new_node = Node(data)

Callers 1

insertMethod · 0.95

Calls 1

NodeClass · 0.70

Tested by

no test coverage detected