From 082960631108c8b0f3257176cc07281b94969c05 Mon Sep 17 00:00:00 2001 From: liurui Date: Thu, 24 Oct 2019 10:53:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=96=87=E5=88=A4=E6=96=AD=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- java/06_linkedlist/SinglyLinkedList.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/06_linkedlist/SinglyLinkedList.java b/java/06_linkedlist/SinglyLinkedList.java index 1a8b0f8..fd7453d 100644 --- a/java/06_linkedlist/SinglyLinkedList.java +++ b/java/06_linkedlist/SinglyLinkedList.java @@ -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; - } + }*/ } // 判断是否为回文