From 71f51fcde4f28abedc24f46c923e9a47b21799b9 Mon Sep 17 00:00:00 2001 From: Chenxue3 <115330251+XueshanChen@users.noreply.github.com> Date: Fri, 29 Dec 2023 20:15:58 +1300 Subject: [PATCH] =?UTF-8?q?Update=20=E9=93=BE=E8=A1=A8=E7=90=86=E8=AE=BA?= =?UTF-8?q?=E5=9F=BA=E7=A1=80.md=20=E6=B7=BB=E5=8A=A0C#=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/链表理论基础.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/problems/链表理论基础.md b/problems/链表理论基础.md index 9dc45242..88e41d7d 100644 --- a/problems/链表理论基础.md +++ b/problems/链表理论基础.md @@ -250,9 +250,32 @@ typedef struct ListNodeT { } ListNode; ``` +### C# + +```c# +public class Node +{ + // 节点存储的数据 + public T Data { get; set; } + + // 指向下一个节点的引用 + public Node Next { get; set; } + + // 节点的构造函数,用于初始化节点 + public Node(T data) + { + Data = data; + Next = null; // 初始时没有下一个节点,因此设为 null + } +} +``` + + + + +

-