mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 15:11:16 +08:00
Add comments to Linked List code.
This commit is contained in:
parent
97926b1243
commit
ecc8c65466
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user