Count nodes in Circular linked list
Oct 30, 2020
Given a circular linked list, count number of nodes in it
def get_length(self):
temp =self.head
count = 0
if temp == None:
return count
while(temp):
count +=1
temp = temp.next
if temp==self.head:
return count