Change the operations sequence of the likedlist's insert() method.

This commit is contained in:
krahets
2023-02-27 20:25:43 +08:00
parent 18f2ec4fdc
commit 9ea24e8b26
11 changed files with 11 additions and 11 deletions

View File

@ -11,8 +11,8 @@ import (
/* 在链表的结点 n0 之后插入结点 P */
func insertNode(n0 *ListNode, P *ListNode) {
n1 := n0.Next
n0.Next = P
P.Next = n1
n0.Next = P
}
/* 删除链表的结点 n0 之后的首个结点 */