This commit is contained in:
Vrutik Jadav 2024-07-13 21:02:08 +02:00 committed by GitHub
commit dc9718a0d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
} }
} }
} }