Bucket sort: scatter values in buckets, sort them and gather them