Question
Show a a method that checks if a given string is a palindrome or not by using an appropriate data structure from the Java collection
Show a a method that checks if a given string is a palindrome or not by using an appropriate data structure from the Java collection framework.
Restrictions
==============
1. Stack and Queue classes are not allowed here.
2. you are allowed only to add(store) into the collection upto half size of the passed string (ex: if the passed string has 6 characters, then we are allowed to have only 3 characters to be stored in the collection).
3. To get the best performance do not traverse the string more than once.
4. No nested loops are allowed. However, sequential loops are OK if they are needed.
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