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

Method insert_at_head

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

Source from the content-addressed store, hash-verified

27 curr.next = new_node
28
29 def insert_at_head(self, data):
30 new_node = Node(data)
31 temp = self.head
32 self.head = new_node
33 new_node.next = temp
34 del temp
35
36 def insert(self, pos, data):
37 if pos < 0 or pos > self.length():

Callers 1

insertMethod · 0.95

Calls 1

NodeClass · 0.70

Tested by

no test coverage detected