A palindrome is a string that reads the same forward and backward, i.e., the letters are the same whether you read them from right to left or from left to right.
Examples:
a) radar -> is a palindrome
b)Able was I ere I saw Elba -> is a palindrome
c)good -> not a palindrome
Write a java program to read a line of text and tell if the line is a palindrome. Use a stack to read each non-blank character on a stack. Treat both upper-case and lower-case version of the letter as being the same character.
- Provide these 5 sample outputs and tell if each is a palindrome or not.
Too bad--I hid a boot
Some men interpret eight memos
"Go Hang a Salami! I'm a Lasagna Hog"
(title of a book on palindromes by Jon Agee, 1991)
A man, a plan, a canalPanama
Gateman sees my name, garageman sees name tag
1. Show the LinkedtStackADT< T > interface
2. Create a LinkedStackDS< T > with the following methods: default constructor, overloaded constructor, copy constructor, isEmptyStack, push, peek, pop
3. Create a private inner StackNode
4. Exception classes: StackException, StackUnderflowException, StackOverflowException
5. Create a PalindromeDemo class that instantiates a LinkedStackDS