Back to the fundamentals: Sorting algorithms in Swift (from scratch!)
Ennio Masi
5833

in BucketSort is a mistake (line 20)

Need change this:

out.append(contentsOf: [Int](repeating: index, count: buckets[value]))

to this:

out.append(contentsOf: [Int](repeating: index, count: value))

Because value already has count of duplicate number, buckets[value] doesn’t make sense.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.