If the flag is true at the end of the function, it signifies that the given string is a palindrome.Increment the value of low by 1 and decrement the value of high by 1.If the characters didn't match, set the flag to false and break the loop.Compare characters at low index and high index.Do the following while low is less than high:.Initialize the high index variable as high and set it to n-1.Initialize the low index variable as low and set it to 0. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |