docs(palindrome): add wikipedia documentation link
parent
849fd9e37c
commit
6a90eb7251
|
@ -2,10 +2,9 @@
|
||||||
A palindrome is a word, phrase, number or sequence of words that reads the same backward as forward. Punctuation and spaces between the words or lettering is allowed.
|
A palindrome is a word, phrase, number or sequence of words that reads the same backward as forward. Punctuation and spaces between the words or lettering is allowed.
|
||||||
|
|
||||||
## Steps
|
## Steps
|
||||||
### Step 1
|
1. Clean the string by removing all punctuation and whitespace and converting all letters to lowercase.
|
||||||
Reverse string.
|
2. Reverse the clean string.
|
||||||
### Step 2
|
3. If the clean string is the same as the reversed string then we have a palindrome.
|
||||||
Compare the reversed string to the original string, if they are equal this mean that string is palindrome.
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -13,11 +12,13 @@ Compare the reversed string to the original string, if they are equal this mean
|
||||||
- Civic
|
- Civic
|
||||||
- Level
|
- Level
|
||||||
- Madam
|
- Madam
|
||||||
|
- Radar
|
||||||
|
|
||||||
### Multiple Word Palindromes
|
### Multiple Word Palindromes
|
||||||
- Don't nod.
|
- Don't nod.
|
||||||
- I did, did I?
|
- I did, did I?
|
||||||
- My gym
|
- My gym
|
||||||
|
- A man, a plan, a canal - Panama
|
||||||
|
|
||||||
## Implementation
|
## Implementation
|
||||||
- [C](../../../algorithms/C/strings/palindrome.c)
|
- [C](../../../algorithms/C/strings/palindrome.c)
|
||||||
|
@ -29,8 +30,8 @@ Compare the reversed string to the original string, if they are equal this mean
|
||||||
- [Rust](../../../algorithms/Rust/strings/palindrome/src/main.rs)
|
- [Rust](../../../algorithms/Rust/strings/palindrome/src/main.rs)
|
||||||
|
|
||||||
## Video URL
|
## Video URL
|
||||||
[A coursera video explaining the palindrome Algorithm](https://www.coursera.org/lecture/program-code/palindrome-algorithm-1-zzQqs)
|
* [A coursera video explaining the palindrome Algorithm](https://www.coursera.org/lecture/program-code/palindrome-algorithm-1-zzQqs)
|
||||||
|
|
||||||
## Others
|
## Others
|
||||||
|
[Wikipedia](https://en.wikipedia.org/wiki/Palindrome)
|
||||||
Any other information is always welcome and should be included in this section.
|
Any other information is always welcome and should be included in this section.
|
||||||
|
|
Loading…
Reference in New Issue