previous |
start |
next
Thinking Recursively
- Step 1: Consider various ways for simplifying inputs.
- How can you simplify the inputs in such a way
that the same problem can be applied to simpler input.
- Here are several possibilities for the
palindrome test problem.
- Remove the first character.
- Remove the last character.
- Remove both the first and last
character.
- Remove a character from the middle.
- Cut the string into two halves.
previous |
start |
next