MCPcopy Index your code
hub / github.com/BeeBombshell/Python-DSA / count

Method count

DSA/SinglyLinkedList.py:21–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19
20 #method to count thee no. of nodes in the list
21 def count(self):
22 if self.isEmpty():
23 return 0
24 n = 0
25 temp = self.head
26 while (temp != None):
27 n += 1
28 temp = temp.next
29 return n
30
31 #method to add an element in the front i.e. head
32 def addFront(self, x):

Callers 1

insertMethod · 0.95

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected