CMPU-102 Spring 2020 Remote Lab 4 Palindromes Revisited The main objective of this lab exercise is to practice using the Abstract Data Types stack and queue in an application, while reusing the MyLinkedList class. In our first remote lab, there was an exercise to determine if the contents of a character array was a palindrome. We will do something similar here, however we will use a String of numbers, a queue, and a stack instead. Similar to last week, there are two interfaces to implement using MyLinkedList: 1. The ADT specifications for the Queue are defined in the IQueue interface. enqueue: adds an element to the end of the list. (If the element is a null reference, then a NullPointerException is thrown.) returns: true upon successfully adding the element. dequeue: remove an element from the top of the list. If the list is empty, then a NoSuchElementException is thrown. returns: the the top element from the list. getSize: provides the number of elements in the set returns: the number of elements in the set toString: provides a String representation of the elements in the set returns: String object that can be used to display the elements in the set. 2. The ADT specifications for the Stack are defined in the IStack interface. push: adds n element to the top of the list. (If the element is a null reference, then a NullPointerException is thrown.) returns: true upon successful add pop: remove an element from the top of the list. If the list is empty, then a NoSuchElementException is thrown. returns: the the top element from the list. getSize: provides the number of elements in the set returns: the number of elements in the set toString: provides a String representation of the elements in the set returns: String object that can be used to display the elements in the set. Implement the queue interface in MyQueue.java and the stack interface in MyStack.java. Then, use them in the new and improved (!) Palindrome class. This class will create an instance of MyQueue and an instance of MyStack. These data structures will contain Integer objects. Don't forget to implement the constructor for this class! There are a few ways to implement the check for Palindromes. One way is to: a) create an isPalindrome() method that accepts a String parameter. It will return true if the string represents a palindrom and false if it does not. The main() method provided in the Palindrome class assumes this to be the implemented. This method should parse the String to create individual digits and push each digit onto the stack as well as enqueue each digit onto the queue. String's substring method can be used to extract individual digits. String's valueOf returns a new instance of java.lang.Integer. b) call another, private isPalindrome method that accepts no parameters. It will pop an Integer from the stack and dequeue an Integer from the queue. If the objects do not match, then set a false boolean variable. If they do match, then continue to pop, dequeue and compare Integers until the stack and queue are emtpy. If all the digits match, then return true, otherwise return false. Of course, both actions can be written in just one method. The main() method is included in the Palindrome class and has a few test cases to run. Also included is a verdict() method and output from a test run. Please be sure to get the code reviewed and checked off by one of the coaches or your professor.