See More

package String; public class LargeWordCount { public static String[] split(String s) { int c = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == ' ') c++; } String[] temp = new String[c + 1]; String t = ""; int i=0; for (int j = 0; j < s.length(); j++) { if (s.charAt(j) != ' ') { t += s.charAt(j); } else { temp[i++] = t; t = ""; } } temp[i] = t; return temp; } public static void sort(String[] s) { for(int j=0;js[i+1].length()) { String t=s[i]; s[i]=s[i+1]; s[i+1]=t; } } } } public static String sortAndCount(String[] sp) { sort(sp); String sx=""; int n; for(int k=0;k