We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3828b54 + 4fb2b45 commit c0bd451Copy full SHA for c0bd451
src/js/data-structures/circular-linked-list.js
@@ -32,7 +32,7 @@ export default class CircularLinkedList extends LinkedList {
32
node.next = this.head;
33
} else {
34
node.next = current;
35
- current = this.getElementAt(this.size());
+ current = this.getElementAt(this.size() - 1);
36
// update last element
37
this.head = node;
38
current.next = this.head;
src/ts/data-structures/circular-linked-list.ts
@@ -36,7 +36,7 @@ export default class CircularLinkedList<T> extends LinkedList<T> {
39
40
41
42
0 commit comments