refactor: Replace 结点 with 节点 (#452)

* Replace 结点 with 节点
Update the footnotes in the figures

* Update mindmap

* Reduce the size of the mindmap.png
This commit is contained in:
Yudong Jin
2023-04-09 04:32:17 +08:00
committed by GitHub
parent 3f4e32b2b0
commit 1c8b7ef559
395 changed files with 2056 additions and 2056 deletions

View File

@@ -8,12 +8,12 @@ using NUnit.Framework;
namespace hello_algo.chapter_stack_and_queue
{
/* 双向链表点 */
/* 双向链表点 */
public class ListNode
{
public int val; // 点值
public ListNode? next; // 后继点引用(指针)
public ListNode? prev; // 前驱点引用(指针)
public int val; // 点值
public ListNode? next; // 后继点引用(指针)
public ListNode? prev; // 前驱点引用(指针)
public ListNode(int val)
{
@@ -26,7 +26,7 @@ namespace hello_algo.chapter_stack_and_queue
/* 基于双向链表实现的双向队列 */
public class LinkedListDeque
{
private ListNode? front, rear; // 头点 front, 尾点 rear
private ListNode? front, rear; // 头点 front, 尾点 rear
private int queSize = 0; // 双向队列的长度
public LinkedListDeque()
@@ -63,7 +63,7 @@ namespace hello_algo.chapter_stack_and_queue
// 将 node 添加至链表头部
front.prev = node;
node.next = front;
front = node; // 更新头
front = node; // 更新头
}
// 队尾入队操作
else
@@ -71,7 +71,7 @@ namespace hello_algo.chapter_stack_and_queue
// 将 node 添加至链表尾部
rear.next = node;
node.prev = rear;
rear = node; // 更新尾
rear = node; // 更新尾
}
queSize++; // 更新队列长度
@@ -102,8 +102,8 @@ namespace hello_algo.chapter_stack_and_queue
// 队首出队操作
if (isFront)
{
val = front.val; // 暂存头点值
// 删除头
val = front.val; // 暂存头点值
// 删除头
ListNode fNext = front.next;
if (fNext != null)
{
@@ -111,13 +111,13 @@ namespace hello_algo.chapter_stack_and_queue
front.next = null;
}
front = fNext; // 更新头
front = fNext; // 更新头
}
// 队尾出队操作
else
{
val = rear.val; // 暂存尾点值
// 删除尾
val = rear.val; // 暂存尾点值
// 删除尾
ListNode rPrev = rear.prev;
if (rPrev != null)
{
@@ -125,7 +125,7 @@ namespace hello_algo.chapter_stack_and_queue
rear.prev = null;
}
rear = rPrev; // 更新尾
rear = rPrev; // 更新尾
}
queSize--; // 更新队列长度

View File

@@ -12,7 +12,7 @@ namespace hello_algo.chapter_stack_and_queue;
/* 基于链表实现的队列 */
class LinkedListQueue
{
private ListNode? front, rear; // 头点 front ,尾点 rear
private ListNode? front, rear; // 头点 front ,尾点 rear
private int queSize = 0;
public LinkedListQueue()
@@ -36,14 +36,14 @@ class LinkedListQueue
/* 入队 */
public void push(int num)
{
// 尾点后添加 num
// 尾点后添加 num
ListNode node = new ListNode(num);
// 如果队列为空,则令头、尾点都指向该
// 如果队列为空,则令头、尾点都指向该
if (front == null)
{
front = node;
rear = node;
// 如果队列不为空,则将该点添加到尾点后
// 如果队列不为空,则将该点添加到尾点后
}
else if (rear != null)
{
@@ -57,7 +57,7 @@ class LinkedListQueue
public int pop()
{
int num = peek();
// 删除头
// 删除头
front = front?.next;
queSize--;
return num;

View File

@@ -12,7 +12,7 @@ namespace hello_algo.chapter_stack_and_queue;
/* 基于链表实现的栈 */
class LinkedListStack
{
private ListNode? stackPeek; // 将头点作为栈顶
private ListNode? stackPeek; // 将头点作为栈顶
private int stkSize = 0; // 栈的长度
public LinkedListStack()