(arr)
return sorted_list
Bucket Sort
        Complexity: O(n^2)
        The complexity is dominated by nextSort
Bucket Sort
        Complexity: O(n^2)
        The complexity is dominated by nextSort
Bucket Sort Complexity : O ( n^2 ) The complexity is dominated by nextSort
def bucket_sort(arr):
    ''' Bucket Sort
        Complexity: O(n^2)
        The complexity is dominated by nextSort
    '''
    # The number of buckets and make buckets
    num_buckets = len(arr)
    buckets = [[] for bucket in range(num_buckets)]
    # Assign values into bucket_sort
    for value in arr:
        index = value * num_buckets // (max(arr) + 1)
        buckets[index].append(value)
    # Sort
    sorted_list = []
    for i in range(num_buckets):
        sorted_list.extend(next_sort(buckets[i]))
    return sorted_list
def bucket_sort ( arr ) : # The number of buckets and make buckets num_buckets = len ( arr ) buckets = [ [ ] for bucket in range ( num_buckets ) ] # Assign values into bucket_sort for value in arr : index = value * num_buckets // ( max ( arr ) + 1 ) buckets [ index ] . append ( value ) # Sort sorted_list = [ ] for i in range ( num_buckets ) : sorted_list . extend ( next_sort ( buckets [ i ] ) ) return sorted_list