Question: A Palindrome is a string that reads the same forward and backward. For instance, mom, radar, level, noon, civic, etc. Write a program to read

A Palindrome is a string that reads the same forward and backward. For instance, mom, radar, level, noon, civic, etc. Write a program to read words from an input file and add it to a queue Q1. For each word in the Q1, use another queue, Q2(or more) to verify whether the word is a palindrome or not. If the word is a palindrome, add it to the end of the queue Q1. Repeat it for all the words in the Q1. The resultant content in the queue need to be written to a file called outputPS1Q1.txt. For n words in the input file, the algorithm should work in time complexity of n or better.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!