Java Palindromes – Stacks and Queues based arrays

SoccerBoss
Category:
Programming
Price: $15 USD

Question description

The question is, Write a Java application that takes a string as input and prints outs whether that string is a palindrome or not. The program should ignore the case, i.e., “radar”, “radaR” are all true palindromes. Your program MUST use Stack and Queue, and the following algorithm: • Read a string. • Push each character of the string in a stack as well as in a queue (both the stack and the queue will have all the characters of the string.) • Now the top of the stack has last character of the string and forward end of the queue has the first character of the string. • Pop a character from the stack and remove a character from forward of the queue, compare both characters. • Continue comparing each character, until all the characters are done. • If all the characters are same then the string is a palindrome, otherwise not. There are easier ways to check for palindromes, but for this project, you MUST implement the above-mentioned algorithm (using Stacks & Queues). Also, you must implement your own array based generic Stack and Queue class. You are NOT allowed to use the built-in Stack and Queue from java.util.

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UIUC
PREMIUM TUTOR
Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1825 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors