Question
I need help with this java program, it is already been done need few changes to it. i am providing the program needed for this.
I need help with this java program, it is already been done need few changes to it. i am providing the program needed for this.
Question needs to be solved:
implement a function to check if a linked list is a palindrome.
--------------------------------------------------------------------------------------------------------------
Driver.java
//import ch06.lists.*; //import support.*;
public class Driver { public static void main(String[] args)
{ //page 469 #51 System.out.println("page 469 #51 testing removeAll() "); RefUnsortedList
-------------------------------------------------------------------------------------------------------------------------------------------
LLNode.java
class LLNode
{ LLNode
{ find(element); return found; } public boolean remove (T element) { find(element); if (found) { if (list == location) list = list.getLink(); else previous.setLink(location.getLink()); numElements--; } return found; } public int removeAll(T ele) { int count =0; while(remove(ele)) count++; return count; } public T get(T element) { find(element); if (found) return location.getInfo(); else return null; } public String toString() { LLNode
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started