mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
Change the operations sequence of the likedlist's insert() method.
This commit is contained in:
@ -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 之后的首个结点 */
|
||||
|
||||
Reference in New Issue
Block a user