@@ -0,0 +1,2290 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage bucketsort;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Random;%0A%0A/**%0A *%0A * @author Dante%0A */%0Apublic class BucketSort %7B%0A%0A    public static int dim = 15;%0A%0A    /**%0A     * @param args the command line arguments%0A     */%0A    static void bucketSort(float arr%5B%5D) %7B%0A        float%5B%5D%5B%5D temp = new float%5Bdim%5D%5Bdim%5D;%0A%0A        int n = arr.length;%0A        int val = 0; %0A%0A        for (int i = 0; i %3C n; i++) %7B%0A            for (int j = 0; j %3C n; j++) %7B%0A                temp%5Bi%5D%5Bj%5D = (float) 0;%0A            %7D%0A        %7D%0A%0A        for (int i = 0; i %3C n; i++) %7B%0A            val = (int) (arr%5Bi%5D * 10);%0A            int j = 0;%0A            while (temp%5Bval%5D%5Bj%5D != 0) %7B%0A                j++;%0A            %7D%0A            temp%5Bval%5D%5Bj%5D = arr%5Bi%5D;%0A        %7D%0A%0A        for (int i = 0; i %3C temp.length; i++) %7B%0A            insertionSort(temp%5Bi%5D);%0A        %7D%0A        int k = 0;%0A        %0A        for (int i = 0; i %3C temp.length; i++) %7B%0A            int j = 0;%0A            for ( j = 0; j %3C temp.length; j++)%7B%0A                if (temp%5Bi%5D%5Bj%5D != 0.0) %7B%0A                    arr%5Bk%5D = temp%5Bi%5D%5Bj%5D;%0A                    k++;%0A                %7D%0A                %0A            %7D%0A%0A        %7D%0A        System.out.println(Arrays.toString(arr));%0A%0A    %7D%0A%0A    private static float%5B%5D insertionSort(float%5B%5D arr) %7B%0A%0A        float temp;%0A%0A        for (int i = 1; i %3C arr.length; i++) %7B%0A            for (int j = i; j %3E 0; j--) %7B%0A                if (arr%5Bj%5D %3C arr%5Bj - 1%5D) %7B%0A                    temp = arr%5Bj%5D;%0A                    arr%5Bj%5D = arr%5Bj - 1%5D;%0A                    arr%5Bj - 1%5D = temp;%0A                %7D%0A            %7D%0A        %7D%0A        return arr;%0A    %7D%0A%0A    public static void main(String args%5B%5D) %7B %0A        float arr%5B%5D = generateRandomNumbers(dim);%0A        System.out.println(Arrays.toString(arr));%0A        bucketSort(arr);%0A %0A    %7D%0A%0A    public static float%5B%5D generateRandomNumbers(int n) %7B%0A %0A        float%5B%5D result = new float%5Bn%5D;%0A        Random random = new Random();%0A%0A        for (int i = 0; i %3C result.length; i++) %7B %0A            result%5Bi%5D = random.nextInt(((100 - 1) + 1) + 1);%0A            result%5Bi%5D = (result%5Bi%5D / 100); %0A        %7D %0A%0A        return result;%0A    %7D%0A%0A%7D%0A

Create BucketSort.java