From 694fbbb19fe1147d28141b204a8c7140689d4d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E7=A8=8B=E4=BA=91?= Date: Sat, 15 Aug 2020 23:48:52 +0800 Subject: [PATCH] remove space --- src/class02/Code02_DeleteGivenValue.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/class02/Code02_DeleteGivenValue.java b/src/class02/Code02_DeleteGivenValue.java index 45f3008..713ff66 100644 --- a/src/class02/Code02_DeleteGivenValue.java +++ b/src/class02/Code02_DeleteGivenValue.java @@ -12,16 +12,15 @@ public class Code02_DeleteGivenValue { } public static Node removeValue(Node head, int num) { + // head来到第一个不需要删的位置 while (head != null) { if (head.value != num) { break; } head = head.next; } - // head来到 第一个不需要删的位置 Node pre = head; Node cur = head; - // while (cur != null) { if (cur.value == num) { pre.next = cur.next;