-
Initialize Variables:
- Set
leftto 0. - Set
rightto the length of the word minus 1.
- Set
-
Looping Condition:
- While
leftis less thanright.
- While
-
Comparison:
- Compare character at index
leftwith character at indexright. - If not equal, return
false.
- Compare character at index
-
Move Indices:
- Increment
leftby 1. - Decrement
rightby 1.
- Increment
-
Completion:
- If loop completes, return
true.
- If loop completes, return
-
Output:
- Call
isPalindromefunction with the word to check. - It Prints the result(
stringis palindrome orstringis not palindrome).
- Call
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|