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
@@ -6,14 +6,14 @@
import utils
/* n0 P */
/* n0 P */
func insert(n0: ListNode, P: ListNode) {
let n1 = n0.next
P.next = n1
n0.next = P
}
/* n0 */
/* n0 */
func remove(n0: ListNode) {
if n0.next == nil {
return
@@ -25,7 +25,7 @@ func remove(n0: ListNode) {
P?.next = nil
}
/* 访 index */
/* 访 index */
func access(head: ListNode, index: Int) -> ListNode? {
var head: ListNode? = head
for _ in 0 ..< index {
@@ -37,7 +37,7 @@ func access(head: ListNode, index: Int) -> ListNode? {
return head
}
/* target */
/* target */
func find(head: ListNode, target: Int) -> Int {
var head: ListNode? = head
var index = 0
@@ -56,7 +56,7 @@ enum LinkedList {
/* Driver Code */
static func main() {
/* */
//
//
let n0 = ListNode(x: 1)
let n1 = ListNode(x: 3)
let n2 = ListNode(x: 2)
@@ -70,22 +70,22 @@ enum LinkedList {
print("初始化的链表为")
PrintUtil.printLinkedList(head: n0)
/* */
/* */
insert(n0: n0, P: ListNode(x: 0))
print("插入点后的链表为")
print("插入点后的链表为")
PrintUtil.printLinkedList(head: n0)
/* */
/* */
remove(n0: n0)
print("删除点后的链表为")
print("删除点后的链表为")
PrintUtil.printLinkedList(head: n0)
/* 访 */
/* 访 */
let node = access(head: n0, index: 3)
print("链表中索引 3 处的点的值 = \(node!.val)")
print("链表中索引 3 处的点的值 = \(node!.val)")
/* */
/* */
let index = find(head: n0, target: 2)
print("链表中值为 2 的点的索引 = \(index)")
print("链表中值为 2 的点的索引 = \(index)")
}
}