A palindrome is a sequence of characters whose reversal gives the same sequence. Examples are “radar” and “noon”. Using a stack and a queue, write an algorithm that reads a string, and determines if the string contains a palindrome/s. Display the palindrome/s found. Implement your algorithm in Java or C++. Note: ➢ convert your string to lowercase ➢ do not use strings or arrays except when implementing the stack and the queue and for storage of your input string ➢ do not use any built-in method to determine if a word is a palindrome Sample runs: 1. Input : madam Output : palindrome/s in the string : madam 2. input : I love madam ABBA  Output : palindrome/s in the string : madam abba ("i" shoud not be included as palindrome) 3. input : the quick brown fox Output : palindrome/s in the string : no palindrome

icon
Related questions
Question

A palindrome is a sequence of characters whose reversal gives the same sequence.
Examples are “radar” and “noon”. Using a stack and a queue, write an algorithm that
reads a string, and determines if the string contains a palindrome/s. Display the
palindrome/s found. Implement your algorithm in Java or C++.


Note:
➢ convert your string to lowercase
do not use strings or arrays except when implementing the stack and the queue
and for storage of your input string
do not use any built-in method to determine if a word is a palindrome

Sample runs:
1. Input : madam
Output : palindrome/s in the string : madam


2. input : I love madam ABBA 
Output : palindrome/s in the string : madam abba

("i" shoud not be included as palindrome)


3. input : the quick brown fox
Output : palindrome/s in the string : no palindrome

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.