Merge pull request #411 from royal-lr/java_06_improve

回文判断完善
This commit is contained in:
wangzheng0822 2019-11-17 09:23:06 +08:00 committed by GitHub
commit 712d77a1f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}
}*/
}
// 判断是否为回文