human
Can you provide a code to sorting without comparison of elements and the other steps required given the following:
Sorting without comparison of elements | Represents node of a doubly linked list.
Count of elements in given range.
Count frequencies of all elements.
Traverse through range . For every element , print it its count times ..
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to sorting without comparison of elements and the other steps required.
 def sortArr ( arr , n , min_no , max_no ) :
	m = max_no - min_no + 1
	c = [ 0 ] * m
	for i in range ( n ) :
		c [ arr [ i ] - min_no ] += 1
	for i in range ( m ) :
		for j in range ( ( c [ i ] ) ) :
			print ( ( i + min_no ) , end = " ▁ " )
arr = [ 10 , 10 , 1 , 4 , 4 , 100 , 0 ]
min_no , max_no = 0 , 100
n = len ( arr )
sortArr ( arr , n , min_no , max_no )