The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
In JAVA CODE on Netbeans, please;
-Create a Helper class to fulfill all the logic requirements of each program.
-Â Create a Tester class that will instantiate the Helper class, and then call the method(s)Â in the Helper class.
Â
Using a Linked List structure, determine whether a linked list contains a Palindrome in integers. For example, the following is a Palindrome:
0->Â 1Â ->Â 2Â ->Â 1Â ->Â 0
Â
To solve this problem, following these steps:
1.)Â reverse the linked list
2.)Â compare the reversed list to the original list
3.) if they're the same, you have a Palindrome.
Â
Create the following methods in a helper class. From the tester/driver class, call isPalindrome(aLL) from main.Â
Create the linked list by hard coding values in the linked list. For example:
Â
LinkedList<String> goodTest = new LinkedList<String>();Â Â Â Â
Â
goodTest.addLast("0");
goodTest.addLast("1");
goodTest.addLast("2");
goodTest.addLast("1");Â
goodTest.addLast("0")
Â
boolean isPalindrome(LinkedList aLL) ~ given a linked list, will return whether the linked list is a Palindrome.
Â
LinkedList reverseAndClone(LinkedList aLL) ~ given a linked list, will return the reversed linked list.
Â
boolean isEqual(LinkedList one, LinkedList two) ~ given the 2 linked lists, will return whether they are both the same.
Â
To test the program, in main method:
1. create a linked list that is a Palindrome, and call the isPalindrome method, passing it a linkedList. Test to ensure it returns True.
2. create a linked list that is NOT a Palindrome, and call the isPalindrome method passing it a linkedList. Test to ensure it returns a False.