完善所以c#相关的文档和代码

This commit is contained in:
zhuzhiqing
2022-12-23 15:42:02 +08:00
parent 1646c284f6
commit a427cb1b4d
48 changed files with 4325 additions and 65 deletions
@@ -35,7 +35,7 @@ namespace hello_algo.chapter_array_and_linkedlist
/// <summary>
/// 访问链表中索引为 index 的结点
/// </summary>
public static ListNode Access(ListNode head, int index)
public static ListNode? Access(ListNode head, int index)
{
for (int i = 0; i < index; i++)
{
@@ -89,8 +89,8 @@ namespace hello_algo.chapter_array_and_linkedlist
Console.WriteLine($"删除结点后的链表为{n0}");
// 访问结点
ListNode node = Access(n0, 3);
Console.WriteLine($"链表中索引 3 处的结点的值 = {node.val}");
ListNode? node = Access(n0, 3);
Console.WriteLine($"链表中索引 3 处的结点的值 = {node?.val}");
// 查找结点
int index = Find(n0, 2);