Skip to content

Commit 4c83a06

Browse files
author
Prateek Khurana
committed
Adding line to modify previous pointer in case of deleting a node in doubly linked list.
1 parent 0183240 commit 4c83a06

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

data-structures/doubly-linked-list/doubly-linked-list.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ DoublyLinkedList.prototype = {
162162

163163
//skip over the item to remove
164164
current.prev.next = current.next;
165+
current.next.prev = current.prev;
165166
}
166167

167168
//decrement the length

0 commit comments

Comments
 (0)