Created
May 2, 2016 13:24
-
-
Save PPartisan/3e63c1e6c2a71adddf21875860be696b to your computer and use it in GitHub Desktop.
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 static char[] reverseCharArray(char[] input){ | |
char[] output = new char[input.length]; | |
char temp; | |
int index = 0; | |
for (int i = (output.length - 1); i >= (output.length/2); i--) { | |
temp = input[i]; | |
output[i] = input[index]; | |
output[index] = temp; | |
index++; | |
} | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment