The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


need your help

Posted by Matt Gerrans on January 29, 2002 at 1:59 PM

> > > I am having problems creating a stack and queue. The problem is as the following:

> > > A Palindrome is a word which reads the same both backwords and fowards. One way to check whether a word is a palindrome is to take each letter of the word one at a time and to place them onto a pile. The letters are then read back from these structures and, if all letters match, the word is a palindrome.e.g tot.

A pile?

Another way to do this is simply copy the string to a StringBuffer, then reverse it with StringBuffer.reverse() and compare the two (probably case-insensitively).

Also, a palindrome may be more than one word.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us