Add code source blocks to the chapter Graph.

Fix "函数" and "方法"
This commit is contained in:
krahets
2023-02-10 01:04:26 +08:00
parent d37c71b928
commit 300016393b
47 changed files with 106 additions and 409 deletions

View File

@@ -11,7 +11,7 @@ class MyList {
private var _size = 0 //
private let extendRatio = 2 //
/* */
/* */
init() {
nums = Array(repeating: 0, count: _capacity)
}

View File

@@ -11,7 +11,7 @@ class GraphAdjMat {
private var vertices: [Int] //
private var adjMat: [[Int]] //
/* */
/* */
init(vertices: [Int], edges: [[Int]]) {
self.vertices = []
adjMat = []

View File

@@ -10,7 +10,7 @@ import utils
class MaxHeap {
private var maxHeap: [Int]
/* */
/* */
init(nums: [Int]) {
//
maxHeap = nums

View File

@@ -95,7 +95,7 @@ class AVLTree {
return root
}
/* */
/* */
private func insertHelper(node: TreeNode?, val: Int) -> TreeNode? {
var node = node
if node == nil {
@@ -123,7 +123,7 @@ class AVLTree {
return root
}
/* */
/* */
private func removeHelper(node: TreeNode?, val: Int) -> TreeNode? {
var node = node
if node == nil {