From ecc8c65466e51e7f50a774e2b1b2707ed586ec1f Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Mon, 30 Jul 2018 15:38:04 +0300 Subject: [PATCH] Add comments to Linked List code. --- src/data-structures/linked-list/LinkedList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data-structures/linked-list/LinkedList.js b/src/data-structures/linked-list/LinkedList.js index ce5a25441..587177f9b 100644 --- a/src/data-structures/linked-list/LinkedList.js +++ b/src/data-structures/linked-list/LinkedList.js @@ -65,7 +65,8 @@ export default class LinkedList { let deletedNode = null; - // If the head must be deleted then make 2nd node to be a head. + // If the head must be deleted then make next node that is differ + // from the head to be a new head. while (this.head && this.compare.equal(this.head.value, value)) { deletedNode = this.head; this.head = this.head.next;