I want to create all possible 5 letter words using a-z.Please suggest any good and fast algorithms.
I have tried creating one and it looks something like this...
byte[] allchar=new byte[] {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int lengthOfAllChar=allchar.length;
System.out.println(lengthOfAllChar);
for (int i = 0; i < lengthOfAllChar; i++){
for(int j = 0; i < lengthOfAllChar; j++){
StringBuffer finalWordBuffer = new StringBuffer();
finalWordBuffer.append((char)allchar[i]);
finalWordBuffer.append((char)allchar[j]);
}
}