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

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 Programming Questions!