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.
1 parent f8545ef commit 3ddbc19Copy full SHA for 3ddbc19
EstruturaDados/LinkedLists.html
@@ -117,9 +117,17 @@ <h1>listas ligadas ou encadeadas</h1>
117
if (current.value === value) {
118
if (prev) {
119
prev.next = current.next
120
+ // Se o nó removido for o tail, atualiza o tail
121
+ if (current === this.tail) {
122
+ this.tail = prev;
123
+ }
124
current.next = null
125
} else {
126
this.head = current.next
127
+ // Se removemos o único elemento da lista, atualiza o tail
128
129
+ this.tail = null;
130
131
132
}
133
this.#size--
0 commit comments