Created
December 16, 2013 05:17
-
-
Save btfak/7982646 to your computer and use it in GitHub Desktop.
to peter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Sort{ | |
private int []letterArray; | |
private void sortLetter(int length) { | |
if (length == 1){ | |
return; | |
} | |
for (int i = 0;i < length-1;i++){ | |
letterArray[i] = letterArray[i] + letterArray[i+1]; | |
System.out.printf("%d ",letterArray[i]); | |
} | |
System.out.printf("\n"); | |
this.sortLetter(length-1); | |
} | |
public static void main(String[] args) { | |
Sort s = new Sort(); | |
s.letterArray = new int[]{2,1,3,1,1,1,1,1,1,1,5,3}; | |
s.sortLetter(s.letterArray.length); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment