Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write a java program using NO arrays and only stacks and queues to accomplish the above requirements: This assignment is to utilize the author's stack
write a java program using NO arrays and only stacks and queues to accomplish the above requirements:
This assignment is to utilize the author's stack code and queue code from chapter 4 to determine if a string is a palindrome (or not). Note that an analysis of your two solutions is required to be compared to the algorithm given in this document. A palindrome is a word that is spelled the same forwards and backwards. Assume that the phrase has been stripped of punctuation and is all the same case. For example, "A man, a plan, a canal. Panama!" is entered as "amanaplanacanalpanama" Data Structure Requirements ( 40%) 1. No arrays are used in main, isPalindromeSTACK, and isPalindromeQUEUE. 2. String data types are permitted 3. Modified and used author's stack code Pop, Push, and isEmpty used 4. Modified and used author's queue code - Algorithm Requirements (40\%) 1. Works! correctly identifies palindromes - Analysis Requirements (20%) Use documentation for the lines in isPalindromeSTACK and isPalindromeQUEUE to show the running time of the code Analyze the following algorithm and compare the running time of the three solutions (i.e, code below, your isPalindromeSTACK and your isPalindromeQUEUE) for i from to n/2 do if a[i]1=a[ni] exit i!=n/2 if returnfalseelse return true
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started