Function linear_sort()

← Back to Module sorting



Module sorting → linear_sort()

Description

Sort an array of positive integers in linear time. Array elements will be arranged from lowest to highest. This function uses Counting Sort as its backend

linear_sort(data)


Parameters


Return Value


Usage Example

import sorting
 
data = [23, 9, 10, 2, 5]
linear_sort(data)