Is LinkedList a Palindrome

My program is totally correct but idk why it is showing an error.

private boolean Ispali(Node right){
if(right==null){
return true;
}
boolean rres=Ispali(right.next);
if(rres==false){
return false;
}else if(pleft.data!=right.data){
return false;
}else{
pleft=pleft.next;
return true;
}
}
Node pleft;
private boolean isPalindrome() {
// write your code here
pleft=head;
return Ispali(head);

}

change your class name to Main
here is your corrected code:

if this solves your doubt please mark it as resolved :slight_smile: