@@ -0,0 +1,1599 @@
+public class BucketSort %7B%0A    private static final int DEFAULT_BUCKET_SIZE = 5;%0A%0A    public static void sort(Integer%5B%5D array) %7B%0A        sort(array, DEFAULT_BUCKET_SIZE);%0A    %7D%0A%0A    public static void sort(Integer%5B%5D array, int bucketSize) %7B%0A        if (array.length == 0) %7B%0A            return;%0A        %7D%0A%0A        // Determine minimum and maximum values%0A        Integer minValue = array%5B0%5D;%0A        Integer maxValue = array%5B0%5D;%0A        for (int i = 1; i %3C array.length; i++) %7B%0A            if (array%5Bi%5D %3C minValue) %7B%0A                minValue = array%5Bi%5D;%0A            %7D else if (array%5Bi%5D %3E maxValue) %7B%0A                maxValue = array%5Bi%5D;%0A            %7D%0A        %7D%0A%0A        // Initialise buckets%0A        int bucketCount = (maxValue - minValue) / bucketSize + 1;%0A        List%3CList%3CInteger%3E%3E buckets = new ArrayList%3CList%3CInteger%3E%3E(bucketCount);%0A        for (int i = 0; i %3C bucketCount; i++) %7B%0A            buckets.add(new ArrayList%3CInteger%3E());%0A        %7D%0A%0A        // Distribute input array values into buckets%0A        for (int i = 0; i %3C array.length; i++) %7B%0A            buckets.get((array%5Bi%5D - minValue) / bucketSize).add(array%5Bi%5D);%0A        %7D%0A%0A        // Sort buckets and place back into input array%0A        int currentIndex = 0;%0A        for (int i = 0; i %3C buckets.size(); i++) %7B%0A            Integer%5B%5D bucketArray = new Integer%5Bbuckets.get(i).size()%5D;%0A            bucketArray = buckets.get(i).toArray(bucketArray);%0A            InsertionSort.sort(bucketArray);%0A            for (int j = 0; j %3C bucketArray.length; j++) %7B%0A                array%5BcurrentIndex++%5D = bucketArray%5Bj%5D;%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

create bucket_sort.java