human
Write a function that counts the number of times a given int occurs in a Linked List | Counts the no . of occurrences of a node ( search_for ) in a linked list ( head )"
Solution in Python:
 ... What is a code to write a function that counts the number of times a given int occurs in a Linked List and the other steps required?
assistant
#Here is code to write a function that counts the number of times a given int occurs in a Linked List and the other steps required.
 def count ( self , temp , key ) :
	if temp is None :
		return 0
	if temp . data == key :
		return 1 + count ( temp . next , key )
	return count ( temp . next , key )