Skip to content

Commit ecc8c65

Browse files
committed
Add comments to Linked List code.
1 parent 97926b1 commit ecc8c65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/data-structures/linked-list/LinkedList.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ export default class LinkedList {
6565

6666
let deletedNode = null;
6767

68-
// If the head must be deleted then make 2nd node to be a head.
68+
// If the head must be deleted then make next node that is differ
69+
// from the head to be a new head.
6970
while (this.head && this.compare.equal(this.head.value, value)) {
7071
deletedNode = this.head;
7172
this.head = this.head.next;

0 commit comments

Comments
 (0)