Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #User function Template for python3
- '''
- #Linked list class
- class LinkedList:
- def __init__(self):
- self.head=None
- self.tail=None
- '''
- class Solution:
- #Function to count nodes of a linked list.
- def getCount(self, head_node):
- count=0
- curr=head_node
- while curr!=None:
- count+=1
- curr=curr.next
- return count
- #code here
Advertisement
Add Comment
Please, Sign In to add comment