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

@@ -4,11 +4,11 @@
* Author: nuomi1 (nuomi1@qq.com)
*/
/* */
/* */
class ListNode {
var val: Int //
var next: ListNode? //
var prev: ListNode? //
var val: Int //
var next: ListNode? //
var prev: ListNode? //
init(val: Int) {
self.val = val
@@ -17,8 +17,8 @@ class ListNode {
/* */
class LinkedListDeque {
private var front: ListNode? // front
private var rear: ListNode? // rear
private var front: ListNode? // front
private var rear: ListNode? // rear
private var queSize: Int //
init() {
@@ -48,14 +48,14 @@ class LinkedListDeque {
// node
front?.prev = node
node.next = front
front = node //
front = node //
}
//
else {
// node
rear?.next = node
node.prev = rear
rear = node //
rear = node //
}
queSize += 1 //
}
@@ -78,25 +78,25 @@ class LinkedListDeque {
let val: Int
//
if isFront {
val = front!.val //
//
val = front!.val //
//
let fNext = front?.next
if fNext != nil {
fNext?.prev = nil
front?.next = nil
}
front = fNext //
front = fNext //
}
//
else {
val = rear!.val //
//
val = rear!.val //
//
let rPrev = rear?.prev
if rPrev != nil {
rPrev?.next = nil
rear?.prev = nil
}
rear = rPrev //
rear = rPrev //
}
queSize -= 1 //
return val

View File

@@ -8,8 +8,8 @@ import utils
/* */
class LinkedListQueue {
private var front: ListNode? //
private var rear: ListNode? //
private var front: ListNode? //
private var rear: ListNode? //
private var _size = 0
init() {}
@@ -26,14 +26,14 @@ class LinkedListQueue {
/* */
func push(num: Int) {
// num
// num
let node = ListNode(x: num)
//
//
if front == nil {
front = node
rear = node
}
//
//
else {
rear?.next = node
rear = node
@@ -45,7 +45,7 @@ class LinkedListQueue {
@discardableResult
func pop() -> Int {
let num = peek()
//
//
front = front?.next
_size -= 1
return num

View File

@@ -8,7 +8,7 @@ import utils
/* */
class LinkedListStack {
private var _peek: ListNode? //
private var _peek: ListNode? //
private var _size = 0 //
init() {}