#-*- coding: UTF-8 -*- import numpy as np def BucketSort(a, n): barrel = np.zeros((1, n), dtype = 'int32') for i in xrange(0,a.size): barrel[0][a[i]] += 1 k = 0 for i in xrange(0,n): if barrel[0][i] != 0: for j in xrange(0,barrel[0][i]): a[k] = i k +…