A palindrome is a string that reads the same forwards as backwards.
Using only a stack and a queue and the stack and queue methods (and some
control flow statements), complete the following class to determine whether
the command line arguments form a palindrome.
public class Palindrome {
public static void main(String[] args) {
boolean palindrome;
if (palindrome) {
System.out.println("This is a palindrome.");
} else {
System.out.println("This is not a palindrome.");
}
}
}
You may use the classes
Stack.java,
Queue.java,
StackException.java,
QueueException.java,
Node.java,
ListStack.java and
ListQueue.java.
For example,
java palindrome l e p e l
should print out
This is a palindrome.