Sponsored Link •
|
Advertisement
|
Advertisement
|
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.
Message:
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 both a stack and a queue. The letters are then read back from these structures and, if all letters match, the word is a palindrome.e.g tot.
CharStack() - the constructor for the class which creates an empty stack. The second class is to be called CharQueue and will offer the following public methods: CharQueue() - the constructor for the class which creates an empty queue. The final class is to be a Java application which uses the above two classes. It should allow the user to type in a word (of an unknown length) and will use the above method of checking whether that word is a palindrome and will report the results to the user. The programme should exit when # is types in. I will be greatful if you can solve my problem by writing this programme. thank you for your time.
Replies:
|
Sponsored Links
|