回文判断完善

This commit is contained in:
liurui 2019-10-24 10:53:31 +08:00
parent e0e4e68e6e
commit 0829606311

View File

@ -172,6 +172,7 @@ public class SinglyLinkedList {
Node l = left;
Node r = right;
boolean flag=true;
System.out.println("left_:"+l.data);
System.out.println("right_:"+r.data);
while(l != null && r != null){
@ -180,18 +181,20 @@ public class SinglyLinkedList {
r = r.next;
continue;
}else{
flag=false;
break;
}
}
System.out.println("什么结果");
if (l==null && r==null){
return flag;
/* if (l==null && r==null){
System.out.println("什么结果");
return true;
}else{
return false;
}
}*/
}
// 判断是否为回文