From 5d418cdab4f14dae865ffe86784f01d7255dd915 Mon Sep 17 00:00:00 2001 From: yangwuse Date: Sat, 27 Mar 2021 17:42:42 +0800 Subject: [PATCH] Update DoublyLinkedList.java reduce repetition --- 1-Fundamentals/1-3-BagsQueuesStacks/DoublyLinkedList.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-Fundamentals/1-3-BagsQueuesStacks/DoublyLinkedList.java b/1-Fundamentals/1-3-BagsQueuesStacks/DoublyLinkedList.java index d55988b..346876e 100644 --- a/1-Fundamentals/1-3-BagsQueuesStacks/DoublyLinkedList.java +++ b/1-Fundamentals/1-3-BagsQueuesStacks/DoublyLinkedList.java @@ -188,8 +188,8 @@ else if (node == last) node.parent = null; DoubleNode prev = node.prev, next = node.next; - prev.next = node.next; - next.prev = node.prev; + prev.next = next; + next.prev = prev; N--; return node.item; }