Created
October 12, 2017 20:49
-
-
Save PanHyridae/5b2dc912a8e67eba6ca991aca2a60274 to your computer and use it in GitHub Desktop.
CheckPalindrome Code from Lecture - 10/12/2017
This file contains hidden or 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 CheckPalindrome { | |
static bool checkPalindrome (String no_c){ | |
if (no_c.length()==1{ | |
return true; | |
} | |
if (no_c.charAt(0) == no_c.charAt(no_c.length()-1)){ | |
return checkPalindrome(no_c.subString(1, no_c.length()-1)); | |
} | |
else{ | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment