Created
April 17, 2012 22:36
-
-
Save rikaardhosein/2409530 to your computer and use it in GitHub Desktop.
Recursive isPlaindrome
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
bool isPalindrome( char *string, unsigned int l, unsigned int r ) | |
{ | |
if( l >= r )return true; | |
if( string[l] != string[r] ) return false; | |
return isPalindrome( string, l+1, r-1 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment