human
Frequency Measuring Techniques for Competitive Programming | Python program to count frequencies of array items.
mark all array elements as not visited.
Traverse through array elements and count frequencies.
Skip this element if already processed.
count frequency.
Driver code"
Solution in Python:
assistant
#Here is code to frequency Measuring Techniques for Competitive Programming and the other steps required.
 def countFreq ( arr , n ) :
	visited = [ False for i in range ( n ) ]
	for i in range ( n ) :
		if visited [ i ] == True :
			continue
		count = 1
		for j in range ( i + 1 , n ) :
			if arr [ i ] == arr [ j ] :
				visited [ j ] = True
				count += 1
		print ( arr [ i ] , count )
a = [ 10 , 20 , 20 , 10 , 10 , 20 , 5 , 20 ]
n = len ( a )
countFreq ( a , n )