mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Merge f4a2006e60
into 9046d80bdb
This commit is contained in:
commit
dc9718a0d4
@ -80,8 +80,10 @@ export default class LinkedList {
|
|||||||
this.tail.next = newNode;
|
this.tail.next = newNode;
|
||||||
this.tail = newNode;
|
this.tail = newNode;
|
||||||
} else {
|
} else {
|
||||||
this.head = newNode;
|
// this.head = newNode;
|
||||||
this.tail = newNode;
|
// this.tail = newNode;
|
||||||
|
newNode.next = this.head;
|
||||||
|
newNode = this.head;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user