def bucket_sort(arr):
<EOL>num_buckets = len(arr)<EOL>buckets = [[] for bucket in range(num_buckets)]<EOL>for value in arr:<EOL><INDENT>index = value * num_buckets // (max(arr) + <NUM_LIT:1>)<EOL>buckets[index].append(value)<EOL><DEDENT>sorted_list = []<EOL>for i in range(num_buckets):<EOL><INDENT>sorted_list.extend(next_sort(buckets[i]))<EOL><DEDENT>return sorted_list<EOL>
Bucket Sort
        Complexity: O(n^2)
        The complexity is dominated by nextSort