@@ -0,0 +1,1314 @@
+package WaveletTree;%0A%0Aimport java.util.Arrays;%0A%0Apublic class WaveletTree %7B%0A%09%0A%09public static void WaveletTrees(String queue, int number) %7B%0A%09%09int i, j, k, count = 0;%0A%09%09String asciiQueue%5B%5D = new String%5Bqueue.length()*number%5D;%0A%09%09String asciiSortQueue%5B%5D= new String%5Bnumber*queue.length()%5D;%0A%09%09String sortQueue = sortString(queue);%0A%09%09int ascii%5B%5D = new int%5BsortQueue.length()%5D;%0A%09%09for(i = 0; i %3C sortQueue.length(); i++) %7B%0A%09%09%09ascii%5Bi%5D += (int)sortQueue.charAt(i);%0A%09%09%09System.out.println(ascii%5Bi%5D);%0A%09%09%09count++;%09%0A%09%09%7D%0A%09%09for(j = 0; j %3C count; j++) %7B%0A%09%09%09asciiSortQueue%5Bj%5D = Integer.toString(ascii%5Bj%5D, number);%0A%09%09%09System.out.println(asciiSortQueue%5Bj%5D);%0A%09%09%7D%0A%09%09%0A%09%09for(k = 0; k %3C queue.length(); k++) %7B%0A%09%09%09//rijesit, vraca null%0A%09%09%09asciiQueue%5Bk%5D += Integer.toString((int)queue.charAt(k), number);%0A%09%09%09System.out.println(Integer.toString((int)queue.charAt(k), number));%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static String sortString(String queue) %7B%0A        int i;%0A        String newString = %22%22;%0A        char chars%5B%5D = queue.toCharArray();%0A        Arrays.sort(chars);%0A        String sortString = new String(chars);%0A         %0A        for(i = 0; i %3C queue.length(); i++) %7B%0A            if (i == 0 %7C%7C sortString.charAt(i) != sortString.charAt(i-1)) %7B%0A                newString += sortString.charAt(i);%0A            %7D%0A        %7D%0A        return newString;%0A    %7D%0A%09%0A%7D%0A

Create WaveletTree.java