code: 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_lisf 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
docs: Bucket Sort
          Complexity: O(n^2)
          The complexity is dominated by nextSort