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

Method length

singly_linked_list.py:11–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9 self.head = None
10
11 def length(self):
12 curr = self.head
13 count = 0
14 while curr.next != None:
15 count += 1
16 curr = curr.next
17 return count
18
19 def add_node(self, data):
20 new_node = Node(data)

Callers 2

insertMethod · 0.95
deleteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected