previous
|
start
|
next
Thinking Recursively
This section gives you a step-by-step guide to the method of recursion.
To illustrate the steps, we will test whether a sentence is a
palindrome
- a string that is equal to itself when you reverse all characters:
Examples:
rotor
A man, a plan, a canal - Panama!
Go hand a salami, I'm a lasagna hog
Madam, I'm Adam
Our goal is to implement a predicate function.
bool is_palindrome(string s)
previous
|
start
|
next