This commit is contained in:
krahets
2023-04-17 21:57:42 +08:00
parent b472215f0e
commit cf4a59e3d6
20 changed files with 247 additions and 198 deletions

View File

@@ -522,8 +522,7 @@ comments: true
```javascript title="linked_list.js"
/* 删除链表的节点 n0 之后的首个节点 */
function remove(n0) {
if (!n0.next)
return;
if (!n0.next) return;
// n0 -> P -> n1
const P = n0.next;
const n1 = P.next;