@ -9,8 +9,8 @@
/* 在链表的结点 n0 之后插入结点 P */
void insert(ListNode* n0, ListNode* P) {
ListNode *n1 = n0->next;
n0->next = P;
P->next = n1;
}
/* 删除链表的结点 n0 之后的首个结点 */
ListNode* n1 = n0->next;
@ -13,8 +13,8 @@ public class linked_list
public static void insert(ListNode n0, ListNode P)
{
ListNode? n1 = n0.next;
n0.next = P;
P.next = n1;
@ -12,8 +12,8 @@ class LinkedList {
void insert(ListNode n0, ListNode P) {
@ -11,8 +11,8 @@ import (
func insertNode(n0 *ListNode, P *ListNode) {
n1 := n0.Next
n0.Next = P
P.Next = n1
@ -12,8 +12,8 @@ public class linked_list {
static void insert(ListNode n0, ListNode P) {
ListNode n1 = n0.next;
@ -10,8 +10,8 @@ const { ListNode } = require("../include/ListNode");
function insert(n0, P) {
const n1 = n0.next;
@ -11,8 +11,8 @@ from include import *
""" 在链表的结点 n0 之后插入结点 P """
def insert(n0, P):
n1 = n0.next
n0.next = P
P.next = n1
""" 删除链表的结点 n0 之后的首个结点 """
def remove(n0):
@ -9,8 +9,8 @@ import utils
func insert(n0: ListNode, P: ListNode) {
let n1 = n0.next
@ -10,8 +10,8 @@ import { printLinkedList } from '../module/PrintUtil';
function insert(n0: ListNode, P: ListNode): void {
@ -8,8 +8,8 @@ const inc = @import("include");
// 在链表的结点 n0 之后插入结点 P
pub fn insert(n0: ?*inc.ListNode(i32), P: ?*inc.ListNode(i32)) void {
var n1 = n0.?.next;
n0.?.next = P;
P.?.next = n1;
// 删除链表的结点 n0 之后的首个结点