Use abbreviation for JavaScript and TypeScript

This commit is contained in:
krahets 2023-07-26 15:35:38 +08:00
parent 85d12360ed
commit b9b324b298
52 changed files with 310 additions and 310 deletions

View File

@ -45,7 +45,7 @@
nums := []int{1, 3, 2, 5, 4}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
/* 初始化数组 */
@ -53,7 +53,7 @@
var nums = [1, 3, 2, 5, 4];
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
/* 初始化数组 */
@ -149,13 +149,13 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
[class]{}-[func]{randomAccess}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
[class]{}-[func]{randomAccess}
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
[class]{}-[func]{randomAccess}
@ -225,13 +225,13 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
[class]{}-[func]{extend}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
[class]{}-[func]{extend}
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
[class]{}-[func]{extend}
@ -301,13 +301,13 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
[class]{}-[func]{insert}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
[class]{}-[func]{insert}
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
[class]{}-[func]{insert}
@ -377,13 +377,13 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
[class]{}-[func]{remove}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
[class]{}-[func]{remove}
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
[class]{}-[func]{remove}
@ -459,13 +459,13 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
[class]{}-[func]{traverse}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
[class]{}-[func]{traverse}
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
[class]{}-[func]{traverse}
@ -533,13 +533,13 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
[class]{}-[func]{find}
```
=== "JavaScript"
=== "JS"
```javascript title="array.js"
[class]{}-[func]{find}
```
=== "TypeScript"
=== "TS"
```typescript title="array.ts"
[class]{}-[func]{find}

View File

@ -58,7 +58,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 链表节点类 */
@ -72,7 +72,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 链表节点类 */
@ -247,7 +247,7 @@
n3.Next = n4
```
=== "JavaScript"
=== "JS"
```javascript title="linked_list.js"
/* 初始化链表 1 -> 3 -> 2 -> 5 -> 4 */
@ -264,7 +264,7 @@
n3.next = n4;
```
=== "TypeScript"
=== "TS"
```typescript title="linked_list.ts"
/* 初始化链表 1 -> 3 -> 2 -> 5 -> 4 */
@ -402,13 +402,13 @@
[class]{}-[func]{insertNode}
```
=== "JavaScript"
=== "JS"
```javascript title="linked_list.js"
[class]{}-[func]{insert}
```
=== "TypeScript"
=== "TS"
```typescript title="linked_list.ts"
[class]{}-[func]{insert}
@ -478,13 +478,13 @@
[class]{}-[func]{removeNode}
```
=== "JavaScript"
=== "JS"
```javascript title="linked_list.js"
[class]{}-[func]{remove}
```
=== "TypeScript"
=== "TS"
```typescript title="linked_list.ts"
[class]{}-[func]{remove}
@ -554,13 +554,13 @@
[class]{}-[func]{access}
```
=== "JavaScript"
=== "JS"
```javascript title="linked_list.js"
[class]{}-[func]{access}
```
=== "TypeScript"
=== "TS"
```typescript title="linked_list.ts"
[class]{}-[func]{access}
@ -632,13 +632,13 @@
[class]{}-[func]{findNode}
```
=== "JavaScript"
=== "JS"
```javascript title="linked_list.js"
[class]{}-[func]{find}
```
=== "TypeScript"
=== "TS"
```typescript title="linked_list.ts"
[class]{}-[func]{find}
@ -743,7 +743,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 双向链表节点类 */
@ -759,7 +759,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 双向链表节点类 */

View File

@ -50,7 +50,7 @@
list := []int{1, 3, 2, 5, 4}
```
=== "JavaScript"
=== "JS"
```javascript title="list.js"
/* 初始化列表 */
@ -60,7 +60,7 @@
const list = [1, 3, 2, 5, 4];
```
=== "TypeScript"
=== "TS"
```typescript title="list.ts"
/* 初始化列表 */
@ -164,7 +164,7 @@
list[1] = 0 // 将索引 1 处的元素更新为 0
```
=== "JavaScript"
=== "JS"
```javascript title="list.js"
/* 访问元素 */
@ -174,7 +174,7 @@
list[1] = 0; // 将索引 1 处的元素更新为 0
```
=== "TypeScript"
=== "TS"
```typescript title="list.ts"
/* 访问元素 */
@ -318,7 +318,7 @@
list = append(list[:3], list[4:]...) // 删除索引 3 处的元素
```
=== "JavaScript"
=== "JS"
```javascript title="list.js"
/* 清空列表 */
@ -338,7 +338,7 @@
list.splice(3, 1);
```
=== "TypeScript"
=== "TS"
```typescript title="list.ts"
/* 清空列表 */
@ -514,7 +514,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title="list.js"
/* 通过索引遍历列表 */
@ -530,7 +530,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title="list.ts"
/* 通过索引遍历列表 */
@ -658,7 +658,7 @@
list = append(list, list1...) // 将列表 list1 拼接到 list 之后
```
=== "JavaScript"
=== "JS"
```javascript title="list.js"
/* 拼接两个列表 */
@ -666,7 +666,7 @@
list.push(...list1); // 将列表 list1 拼接到 list 之后
```
=== "TypeScript"
=== "TS"
```typescript title="list.ts"
/* 拼接两个列表 */
@ -750,14 +750,14 @@
sort.Ints(list) // 排序后,列表元素从小到大排列
```
=== "JavaScript"
=== "JS"
```javascript title="list.js"
/* 排序列表 */
list.sort((a, b) => a - b); // 排序后,列表元素从小到大排列
```
=== "TypeScript"
=== "TS"
```typescript title="list.ts"
/* 排序列表 */
@ -838,13 +838,13 @@
[class]{myList}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="my_list.js"
[class]{MyList}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="my_list.ts"
[class]{MyList}-[func]{}

View File

@ -34,13 +34,13 @@
[class]{}-[func]{preOrderI}
```
=== "JavaScript"
=== "JS"
```javascript title="preorder_traversal_i_compact.js"
[class]{}-[func]{preOrder}
```
=== "TypeScript"
=== "TS"
```typescript title="preorder_traversal_i_compact.ts"
[class]{}-[func]{preOrder}
@ -122,13 +122,13 @@
[class]{}-[func]{preOrderII}
```
=== "JavaScript"
=== "JS"
```javascript title="preorder_traversal_ii_compact.js"
[class]{}-[func]{preOrder}
```
=== "TypeScript"
=== "TS"
```typescript title="preorder_traversal_ii_compact.ts"
[class]{}-[func]{preOrder}
@ -241,13 +241,13 @@
[class]{}-[func]{preOrderIII}
```
=== "JavaScript"
=== "JS"
```javascript title="preorder_traversal_iii_compact.js"
[class]{}-[func]{preOrder}
```
=== "TypeScript"
=== "TS"
```typescript title="preorder_traversal_iii_compact.ts"
[class]{}-[func]{preOrder}
@ -399,7 +399,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 回溯算法框架 */
@ -425,7 +425,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 回溯算法框架 */
@ -633,7 +633,7 @@
[class]{}-[func]{backtrackIII}
```
=== "JavaScript"
=== "JS"
```javascript title="preorder_traversal_iii_template.js"
[class]{}-[func]{isSolution}
@ -649,7 +649,7 @@
[class]{}-[func]{backtrack}
```
=== "TypeScript"
=== "TS"
```typescript title="preorder_traversal_iii_template.ts"
[class]{}-[func]{isSolution}

View File

@ -72,7 +72,7 @@
[class]{}-[func]{nQueens}
```
=== "JavaScript"
=== "JS"
```javascript title="n_queens.js"
[class]{}-[func]{backtrack}
@ -80,7 +80,7 @@
[class]{}-[func]{nQueens}
```
=== "TypeScript"
=== "TS"
```typescript title="n_queens.ts"
[class]{}-[func]{backtrack}

View File

@ -77,7 +77,7 @@
[class]{}-[func]{permutationsI}
```
=== "JavaScript"
=== "JS"
```javascript title="permutations_i.js"
[class]{}-[func]{backtrack}
@ -85,7 +85,7 @@
[class]{}-[func]{permutationsI}
```
=== "TypeScript"
=== "TS"
```typescript title="permutations_i.ts"
[class]{}-[func]{backtrack}
@ -201,7 +201,7 @@
[class]{}-[func]{permutationsII}
```
=== "JavaScript"
=== "JS"
```javascript title="permutations_ii.js"
[class]{}-[func]{backtrack}
@ -209,7 +209,7 @@
[class]{}-[func]{permutationsII}
```
=== "TypeScript"
=== "TS"
```typescript title="permutations_ii.ts"
[class]{}-[func]{backtrack}

View File

@ -49,7 +49,7 @@
[class]{}-[func]{subsetSumINaive}
```
=== "JavaScript"
=== "JS"
```javascript title="subset_sum_i_naive.js"
[class]{}-[func]{backtrack}
@ -57,7 +57,7 @@
[class]{}-[func]{subsetSumINaive}
```
=== "TypeScript"
=== "TS"
```typescript title="subset_sum_i_naive.ts"
[class]{}-[func]{backtrack}
@ -182,7 +182,7 @@
[class]{}-[func]{subsetSumI}
```
=== "JavaScript"
=== "JS"
```javascript title="subset_sum_i.js"
[class]{}-[func]{backtrack}
@ -190,7 +190,7 @@
[class]{}-[func]{subsetSumI}
```
=== "TypeScript"
=== "TS"
```typescript title="subset_sum_i.ts"
[class]{}-[func]{backtrack}
@ -302,7 +302,7 @@
[class]{}-[func]{subsetSumII}
```
=== "JavaScript"
=== "JS"
```javascript title="subset_sum_ii.js"
[class]{}-[func]{backtrack}
@ -310,7 +310,7 @@
[class]{}-[func]{subsetSumII}
```
=== "TypeScript"
=== "TS"
```typescript title="subset_sum_ii.ts"
[class]{}-[func]{backtrack}

View File

@ -123,7 +123,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 类 */
@ -151,7 +151,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 类 */
@ -341,7 +341,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
function algorithm(n) {
@ -353,7 +353,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
function algorithm(n: number): void {
@ -508,7 +508,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
function constFunc() {
@ -528,7 +528,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
function constFunc(): number {
@ -692,13 +692,13 @@ $$
[class]{}-[func]{spaceConstant}
```
=== "JavaScript"
=== "JS"
```javascript title="space_complexity.js"
[class]{}-[func]{constant}
```
=== "TypeScript"
=== "TS"
```typescript title="space_complexity.ts"
[class]{}-[func]{constant}
@ -768,13 +768,13 @@ $$
[class]{}-[func]{spaceLinear}
```
=== "JavaScript"
=== "JS"
```javascript title="space_complexity.js"
[class]{}-[func]{linear}
```
=== "TypeScript"
=== "TS"
```typescript title="space_complexity.ts"
[class]{}-[func]{linear}
@ -844,13 +844,13 @@ $$
[class]{}-[func]{spaceLinearRecur}
```
=== "JavaScript"
=== "JS"
```javascript title="space_complexity.js"
[class]{}-[func]{linearRecur}
```
=== "TypeScript"
=== "TS"
```typescript title="space_complexity.ts"
[class]{}-[func]{linearRecur}
@ -922,13 +922,13 @@ $$
[class]{}-[func]{spaceQuadratic}
```
=== "JavaScript"
=== "JS"
```javascript title="space_complexity.js"
[class]{}-[func]{quadratic}
```
=== "TypeScript"
=== "TS"
```typescript title="space_complexity.ts"
[class]{}-[func]{quadratic}
@ -996,13 +996,13 @@ $$
[class]{}-[func]{spaceQuadraticRecur}
```
=== "JavaScript"
=== "JS"
```javascript title="space_complexity.js"
[class]{}-[func]{quadraticRecur}
```
=== "TypeScript"
=== "TS"
```typescript title="space_complexity.ts"
[class]{}-[func]{quadraticRecur}
@ -1074,13 +1074,13 @@ $$
[class]{}-[func]{buildTree}
```
=== "JavaScript"
=== "JS"
```javascript title="space_complexity.js"
[class]{}-[func]{buildTree}
```
=== "TypeScript"
=== "TS"
```typescript title="space_complexity.ts"
[class]{}-[func]{buildTree}

View File

@ -72,7 +72,7 @@ $$
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
// 在某运行平台下
@ -87,7 +87,7 @@ $$
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
// 在某运行平台下
@ -265,7 +265,7 @@ $$
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
// 算法 A 时间复杂度:常数阶
@ -287,7 +287,7 @@ $$
```
=== "TypeScript"
=== "TS"
```typescript title=""
// 算法 A 时间复杂度:常数阶
@ -478,7 +478,7 @@ $$
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
function algorithm(n) {
@ -492,7 +492,7 @@ $$
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
function algorithm(n: number): void{
@ -693,7 +693,7 @@ $$
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
function algorithm(n) {
@ -712,7 +712,7 @@ $$
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
function algorithm(n: number): void {
@ -884,13 +884,13 @@ $$
[class]{}-[func]{constant}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{constant}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{constant}
@ -960,13 +960,13 @@ $$
[class]{}-[func]{linear}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{linear}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{linear}
@ -1038,13 +1038,13 @@ $$
[class]{}-[func]{arrayTraversal}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{arrayTraversal}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{arrayTraversal}
@ -1114,13 +1114,13 @@ $$
[class]{}-[func]{quadratic}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{quadratic}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{quadratic}
@ -1194,13 +1194,13 @@ $$
[class]{}-[func]{bubbleSort}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{bubbleSort}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{bubbleSort}
@ -1274,13 +1274,13 @@ $$
[class]{}-[func]{exponential}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{exponential}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{exponential}
@ -1350,13 +1350,13 @@ $$
[class]{}-[func]{expRecur}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{expRecur}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{expRecur}
@ -1430,13 +1430,13 @@ $$
[class]{}-[func]{logarithmic}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{logarithmic}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{logarithmic}
@ -1506,13 +1506,13 @@ $$
[class]{}-[func]{logRecur}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{logRecur}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{logRecur}
@ -1584,13 +1584,13 @@ $$
[class]{}-[func]{linearLogRecur}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{linearLogRecur}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{linearLogRecur}
@ -1668,13 +1668,13 @@ $$
[class]{}-[func]{factorialRecur}
```
=== "JavaScript"
=== "JS"
```javascript title="time_complexity.js"
[class]{}-[func]{factorialRecur}
```
=== "TypeScript"
=== "TS"
```typescript title="time_complexity.ts"
[class]{}-[func]{factorialRecur}
@ -1759,7 +1759,7 @@ $$
[class]{}-[func]{findOne}
```
=== "JavaScript"
=== "JS"
```javascript title="worst_best_time_complexity.js"
[class]{}-[func]{randomNumbers}
@ -1767,7 +1767,7 @@ $$
[class]{}-[func]{findOne}
```
=== "TypeScript"
=== "TS"
```typescript title="worst_best_time_complexity.ts"
[class]{}-[func]{randomNumbers}

View File

@ -78,14 +78,14 @@
var booleans = [5]bool{}
```
=== "JavaScript"
=== "JS"
```javascript title=""
// JavaScript 的数组可以自由存储各种基本数据类型和对象
const array = [0, 0.0, 'a', false];
```
=== "TypeScript"
=== "TS"
```typescript title=""
// 使用多种基本数据类型来初始化数组

View File

@ -72,7 +72,7 @@
[class]{}-[func]{binarySearch}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search_recur.js"
[class]{}-[func]{dfs}
@ -80,7 +80,7 @@
[class]{}-[func]{binarySearch}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search_recur.ts"
[class]{}-[func]{dfs}

View File

@ -91,7 +91,7 @@
[class]{}-[func]{buildTree}
```
=== "JavaScript"
=== "JS"
```javascript title="build_tree.js"
[class]{}-[func]{dfs}
@ -99,7 +99,7 @@
[class]{}-[func]{buildTree}
```
=== "TypeScript"
=== "TS"
```typescript title="build_tree.ts"
[class]{}-[func]{dfs}

View File

@ -122,7 +122,7 @@
[class]{}-[func]{hanota}
```
=== "JavaScript"
=== "JS"
```javascript title="hanota.js"
[class]{}-[func]{move}
@ -132,7 +132,7 @@
[class]{}-[func]{hanota}
```
=== "TypeScript"
=== "TS"
```typescript title="hanota.ts"
[class]{}-[func]{move}

View File

@ -58,13 +58,13 @@ $$
[class]{}-[func]{minCostClimbingStairsDP}
```
=== "JavaScript"
=== "JS"
```javascript title="min_cost_climbing_stairs_dp.js"
[class]{}-[func]{minCostClimbingStairsDP}
```
=== "TypeScript"
=== "TS"
```typescript title="min_cost_climbing_stairs_dp.ts"
[class]{}-[func]{minCostClimbingStairsDP}
@ -134,13 +134,13 @@ $$
[class]{}-[func]{minCostClimbingStairsDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="min_cost_climbing_stairs_dp.js"
[class]{}-[func]{minCostClimbingStairsDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="min_cost_climbing_stairs_dp.ts"
[class]{}-[func]{minCostClimbingStairsDPComp}
@ -244,13 +244,13 @@ $$
[class]{}-[func]{climbingStairsConstraintDP}
```
=== "JavaScript"
=== "JS"
```javascript title="climbing_stairs_constraint_dp.js"
[class]{}-[func]{climbingStairsConstraintDP}
```
=== "TypeScript"
=== "TS"
```typescript title="climbing_stairs_constraint_dp.ts"
[class]{}-[func]{climbingStairsConstraintDP}

View File

@ -122,13 +122,13 @@ $$
[class]{}-[func]{minPathSumDFS}
```
=== "JavaScript"
=== "JS"
```javascript title="min_path_sum.js"
[class]{}-[func]{minPathSumDFS}
```
=== "TypeScript"
=== "TS"
```typescript title="min_path_sum.ts"
[class]{}-[func]{minPathSumDFS}
@ -206,13 +206,13 @@ $$
[class]{}-[func]{minPathSumDFSMem}
```
=== "JavaScript"
=== "JS"
```javascript title="min_path_sum.js"
[class]{}-[func]{minPathSumDFSMem}
```
=== "TypeScript"
=== "TS"
```typescript title="min_path_sum.ts"
[class]{}-[func]{minPathSumDFSMem}
@ -286,13 +286,13 @@ $$
[class]{}-[func]{minPathSumDP}
```
=== "JavaScript"
=== "JS"
```javascript title="min_path_sum.js"
[class]{}-[func]{minPathSumDP}
```
=== "TypeScript"
=== "TS"
```typescript title="min_path_sum.ts"
[class]{}-[func]{minPathSumDP}
@ -404,13 +404,13 @@ $$
[class]{}-[func]{minPathSumDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="min_path_sum.js"
[class]{}-[func]{minPathSumDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="min_path_sum.ts"
[class]{}-[func]{minPathSumDPComp}

View File

@ -89,13 +89,13 @@ $$
[class]{}-[func]{editDistanceDP}
```
=== "JavaScript"
=== "JS"
```javascript title="edit_distance.js"
[class]{}-[func]{editDistanceDP}
```
=== "TypeScript"
=== "TS"
```typescript title="edit_distance.ts"
[class]{}-[func]{editDistanceDP}
@ -214,13 +214,13 @@ $$
[class]{}-[func]{editDistanceDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="edit_distance.js"
[class]{}-[func]{editDistanceDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="edit_distance.ts"
[class]{}-[func]{editDistanceDPComp}

View File

@ -46,7 +46,7 @@
[class]{}-[func]{climbingStairsBacktrack}
```
=== "JavaScript"
=== "JS"
```javascript title="climbing_stairs_backtrack.js"
[class]{}-[func]{backtrack}
@ -54,7 +54,7 @@
[class]{}-[func]{climbingStairsBacktrack}
```
=== "TypeScript"
=== "TS"
```typescript title="climbing_stairs_backtrack.ts"
[class]{}-[func]{backtrack}
@ -171,7 +171,7 @@ $$
[class]{}-[func]{climbingStairsDFS}
```
=== "JavaScript"
=== "JS"
```javascript title="climbing_stairs_dfs.js"
[class]{}-[func]{dfs}
@ -179,7 +179,7 @@ $$
[class]{}-[func]{climbingStairsDFS}
```
=== "TypeScript"
=== "TS"
```typescript title="climbing_stairs_dfs.ts"
[class]{}-[func]{dfs}
@ -282,7 +282,7 @@ $$
[class]{}-[func]{climbingStairsDFSMem}
```
=== "JavaScript"
=== "JS"
```javascript title="climbing_stairs_dfs_mem.js"
[class]{}-[func]{dfs}
@ -290,7 +290,7 @@ $$
[class]{}-[func]{climbingStairsDFSMem}
```
=== "TypeScript"
=== "TS"
```typescript title="climbing_stairs_dfs_mem.ts"
[class]{}-[func]{dfs}
@ -382,13 +382,13 @@ $$
[class]{}-[func]{climbingStairsDP}
```
=== "JavaScript"
=== "JS"
```javascript title="climbing_stairs_dp.js"
[class]{}-[func]{climbingStairsDP}
```
=== "TypeScript"
=== "TS"
```typescript title="climbing_stairs_dp.ts"
[class]{}-[func]{climbingStairsDP}
@ -468,13 +468,13 @@ $$
[class]{}-[func]{climbingStairsDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="climbing_stairs_dp.js"
[class]{}-[func]{climbingStairsDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="climbing_stairs_dp.ts"
[class]{}-[func]{climbingStairsDPComp}

View File

@ -80,13 +80,13 @@ $$
[class]{}-[func]{knapsackDFS}
```
=== "JavaScript"
=== "JS"
```javascript title="knapsack.js"
[class]{}-[func]{knapsackDFS}
```
=== "TypeScript"
=== "TS"
```typescript title="knapsack.ts"
[class]{}-[func]{knapsackDFS}
@ -164,13 +164,13 @@ $$
[class]{}-[func]{knapsackDFSMem}
```
=== "JavaScript"
=== "JS"
```javascript title="knapsack.js"
[class]{}-[func]{knapsackDFSMem}
```
=== "TypeScript"
=== "TS"
```typescript title="knapsack.ts"
[class]{}-[func]{knapsackDFSMem}
@ -242,13 +242,13 @@ $$
[class]{}-[func]{knapsackDP}
```
=== "JavaScript"
=== "JS"
```javascript title="knapsack.js"
[class]{}-[func]{knapsackDP}
```
=== "TypeScript"
=== "TS"
```typescript title="knapsack.ts"
[class]{}-[func]{knapsackDP}
@ -389,13 +389,13 @@ $$
[class]{}-[func]{knapsackDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="knapsack.js"
[class]{}-[func]{knapsackDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="knapsack.ts"
[class]{}-[func]{knapsackDPComp}

View File

@ -54,13 +54,13 @@ $$
[class]{}-[func]{unboundedKnapsackDP}
```
=== "JavaScript"
=== "JS"
```javascript title="unbounded_knapsack.js"
[class]{}-[func]{unboundedKnapsackDP}
```
=== "TypeScript"
=== "TS"
```typescript title="unbounded_knapsack.ts"
[class]{}-[func]{unboundedKnapsackDP}
@ -152,13 +152,13 @@ $$
[class]{}-[func]{unboundedKnapsackDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="unbounded_knapsack.js"
[class]{}-[func]{unboundedKnapsackDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="unbounded_knapsack.ts"
[class]{}-[func]{unboundedKnapsackDPComp}
@ -271,13 +271,13 @@ $$
[class]{}-[func]{coinChangeDP}
```
=== "JavaScript"
=== "JS"
```javascript title="coin_change.js"
[class]{}-[func]{coinChangeDP}
```
=== "TypeScript"
=== "TS"
```typescript title="coin_change.ts"
[class]{}-[func]{coinChangeDP}
@ -394,13 +394,13 @@ $$
[class]{}-[func]{coinChangeDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="coin_change.js"
[class]{}-[func]{coinChangeDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="coin_change.ts"
[class]{}-[func]{coinChangeDPComp}
@ -486,13 +486,13 @@ $$
[class]{}-[func]{coinChangeIIDP}
```
=== "JavaScript"
=== "JS"
```javascript title="coin_change_ii.js"
[class]{}-[func]{coinChangeIIDP}
```
=== "TypeScript"
=== "TS"
```typescript title="coin_change_ii.ts"
[class]{}-[func]{coinChangeIIDP}
@ -562,13 +562,13 @@ $$
[class]{}-[func]{coinChangeIIDPComp}
```
=== "JavaScript"
=== "JS"
```javascript title="coin_change_ii.js"
[class]{}-[func]{coinChangeIIDPComp}
```
=== "TypeScript"
=== "TS"
```typescript title="coin_change_ii.ts"
[class]{}-[func]{coinChangeIIDPComp}

View File

@ -52,13 +52,13 @@
[class]{graphAdjMat}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="graph_adjacency_matrix.js"
[class]{GraphAdjMat}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="graph_adjacency_matrix.ts"
[class]{GraphAdjMat}-[func]{}
@ -155,13 +155,13 @@
[class]{graphAdjList}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="graph_adjacency_list.js"
[class]{GraphAdjList}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="graph_adjacency_list.ts"
[class]{GraphAdjList}-[func]{}

View File

@ -48,13 +48,13 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
[class]{}-[func]{graphBFS}
```
=== "JavaScript"
=== "JS"
```javascript title="graph_bfs.js"
[class]{}-[func]{graphBFS}
```
=== "TypeScript"
=== "TS"
```typescript title="graph_bfs.ts"
[class]{}-[func]{graphBFS}
@ -183,7 +183,7 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
[class]{}-[func]{graphDFS}
```
=== "JavaScript"
=== "JS"
```javascript title="graph_dfs.js"
[class]{}-[func]{dfs}
@ -191,7 +191,7 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
[class]{}-[func]{graphDFS}
```
=== "TypeScript"
=== "TS"
```typescript title="graph_dfs.ts"
[class]{}-[func]{dfs}

View File

@ -63,7 +63,7 @@
[class]{}-[func]{fractionalKnapsack}
```
=== "JavaScript"
=== "JS"
```javascript title="fractional_knapsack.js"
[class]{Item}-[func]{}
@ -71,7 +71,7 @@
[class]{}-[func]{fractionalKnapsack}
```
=== "TypeScript"
=== "TS"
```typescript title="fractional_knapsack.ts"
[class]{Item}-[func]{}

View File

@ -43,13 +43,13 @@
[class]{}-[func]{coinChangeGreedy}
```
=== "JavaScript"
=== "JS"
```javascript title="coin_change_greedy.js"
[class]{}-[func]{coinChangeGreedy}
```
=== "TypeScript"
=== "TS"
```typescript title="coin_change_greedy.ts"
[class]{}-[func]{coinChangeGreedy}

View File

@ -101,13 +101,13 @@ $$
[class]{}-[func]{maxCapacity}
```
=== "JavaScript"
=== "JS"
```javascript title="max_capacity.js"
[class]{}-[func]{maxCapacity}
```
=== "TypeScript"
=== "TS"
```typescript title="max_capacity.ts"
[class]{}-[func]{maxCapacity}

View File

@ -87,13 +87,13 @@ $$
[class]{}-[func]{maxProductCutting}
```
=== "JavaScript"
=== "JS"
```javascript title="max_product_cutting.js"
[class]{}-[func]{maxProductCutting}
```
=== "TypeScript"
=== "TS"
```typescript title="max_product_cutting.ts"
[class]{}-[func]{maxProductCutting}

View File

@ -93,7 +93,7 @@ index = hash(key) % capacity
[class]{}-[func]{rotHash}
```
=== "JavaScript"
=== "JS"
```javascript title="simple_hash.js"
[class]{}-[func]{addHash}
@ -105,7 +105,7 @@ index = hash(key) % capacity
[class]{}-[func]{rotHash}
```
=== "TypeScript"
=== "TS"
```typescript title="simple_hash.ts"
[class]{}-[func]{addHash}
@ -335,13 +335,13 @@ $$
```
=== "JavaScript"
=== "JS"
```javascript title="built_in_hash.js"
```
=== "TypeScript"
=== "TS"
```typescript title="built_in_hash.ts"

View File

@ -55,13 +55,13 @@
[class]{hashMapChaining}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="hash_map_chaining.js"
[class]{HashMapChaining}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="hash_map_chaining.ts"
[class]{HashMapChaining}-[func]{}
@ -154,13 +154,13 @@
[class]{hashMapOpenAddressing}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="hash_map_open_addressing.js"
[class]{HashMapOpenAddressing}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="hash_map_open_addressing.ts"
[class]{HashMapOpenAddressing}-[func]{}

View File

@ -120,7 +120,7 @@
delete(mapp, 10583)
```
=== "JavaScript"
=== "JS"
```javascript title="hash_map.js"
/* 初始化哈希表 */
@ -142,7 +142,7 @@
map.delete(10583);
```
=== "TypeScript"
=== "TS"
```typescript title="hash_map.ts"
/* 初始化哈希表 */
@ -327,7 +327,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title="hash_map.js"
/* 遍历哈希表 */
@ -345,7 +345,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title="hash_map.ts"
/* 遍历哈希表 */
@ -492,7 +492,7 @@ index = hash(key) % capacity
[class]{arrayHashMap}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="array_hash_map.js"
[class]{Pair}-[func]{}
@ -500,7 +500,7 @@ index = hash(key) % capacity
[class]{ArrayHashMap}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="array_hash_map.ts"
[class]{Pair}-[func]{}

View File

@ -36,13 +36,13 @@
[class]{maxHeap}-[func]{newMaxHeap}
```
=== "JavaScript"
=== "JS"
```javascript title="my_heap.js"
[class]{MaxHeap}-[func]{constructor}
```
=== "TypeScript"
=== "TS"
```typescript title="my_heap.ts"
[class]{MaxHeap}-[func]{constructor}

View File

@ -234,13 +234,13 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title="heap.js"
// JavaScript 未提供内置 Heap 类
```
=== "TypeScript"
=== "TS"
```typescript title="heap.ts"
// TypeScript 未提供内置 Heap 类
@ -369,7 +369,7 @@
[class]{maxHeap}-[func]{parent}
```
=== "JavaScript"
=== "JS"
```javascript title="my_heap.js"
[class]{MaxHeap}-[func]{#left}
@ -379,7 +379,7 @@
[class]{MaxHeap}-[func]{#parent}
```
=== "TypeScript"
=== "TS"
```typescript title="my_heap.ts"
[class]{MaxHeap}-[func]{left}
@ -477,13 +477,13 @@
[class]{maxHeap}-[func]{peek}
```
=== "JavaScript"
=== "JS"
```javascript title="my_heap.js"
[class]{MaxHeap}-[func]{peek}
```
=== "TypeScript"
=== "TS"
```typescript title="my_heap.ts"
[class]{MaxHeap}-[func]{peek}
@ -592,7 +592,7 @@
[class]{maxHeap}-[func]{siftUp}
```
=== "JavaScript"
=== "JS"
```javascript title="my_heap.js"
[class]{MaxHeap}-[func]{push}
@ -600,7 +600,7 @@
[class]{MaxHeap}-[func]{#siftUp}
```
=== "TypeScript"
=== "TS"
```typescript title="my_heap.ts"
[class]{MaxHeap}-[func]{push}
@ -730,7 +730,7 @@
[class]{maxHeap}-[func]{siftDown}
```
=== "JavaScript"
=== "JS"
```javascript title="my_heap.js"
[class]{MaxHeap}-[func]{pop}
@ -738,7 +738,7 @@
[class]{MaxHeap}-[func]{#siftDown}
```
=== "TypeScript"
=== "TS"
```typescript title="my_heap.ts"
[class]{MaxHeap}-[func]{pop}

View File

@ -90,13 +90,13 @@
[class]{}-[func]{topKHeap}
```
=== "JavaScript"
=== "JS"
```javascript title="top_k.js"
[class]{}-[func]{topKHeap}
```
=== "TypeScript"
=== "TS"
```typescript title="top_k.ts"
[class]{}-[func]{topKHeap}

View File

@ -65,7 +65,7 @@
*/
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 标题注释,用于标注函数、类、测试样例等 */
@ -78,7 +78,7 @@
*/
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 标题注释,用于标注函数、类、测试样例等 */

View File

@ -68,13 +68,13 @@
[class]{}-[func]{binarySearch}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search.js"
[class]{}-[func]{binarySearch}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search.ts"
[class]{}-[func]{binarySearch}
@ -150,13 +150,13 @@
[class]{}-[func]{binarySearchLCRO}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search.js"
[class]{}-[func]{binarySearchLCRO}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search.ts"
[class]{}-[func]{binarySearchLCRO}

View File

@ -76,13 +76,13 @@
[class]{}-[func]{binarySearchLeftEdge}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search_edge.js"
[class]{}-[func]{binarySearchLeftEdge}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search_edge.ts"
[class]{}-[func]{binarySearchLeftEdge}
@ -154,13 +154,13 @@
[class]{}-[func]{binarySearchRightEdge}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search_edge.js"
[class]{}-[func]{binarySearchRightEdge}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search_edge.ts"
[class]{}-[func]{binarySearchRightEdge}

View File

@ -36,13 +36,13 @@
[class]{}-[func]{twoSumBruteForce}
```
=== "JavaScript"
=== "JS"
```javascript title="two_sum.js"
[class]{}-[func]{twoSumBruteForce}
```
=== "TypeScript"
=== "TS"
```typescript title="two_sum.ts"
[class]{}-[func]{twoSumBruteForce}
@ -128,13 +128,13 @@
[class]{}-[func]{twoSumHashTable}
```
=== "JavaScript"
=== "JS"
```javascript title="two_sum.js"
[class]{}-[func]{twoSumHashTable}
```
=== "TypeScript"
=== "TS"
```typescript title="two_sum.ts"
[class]{}-[func]{twoSumHashTable}

View File

@ -60,13 +60,13 @@
[class]{}-[func]{bubbleSort}
```
=== "JavaScript"
=== "JS"
```javascript title="bubble_sort.js"
[class]{}-[func]{bubbleSort}
```
=== "TypeScript"
=== "TS"
```typescript title="bubble_sort.ts"
[class]{}-[func]{bubbleSort}
@ -138,13 +138,13 @@
[class]{}-[func]{bubbleSortWithFlag}
```
=== "JavaScript"
=== "JS"
```javascript title="bubble_sort.js"
[class]{}-[func]{bubbleSortWithFlag}
```
=== "TypeScript"
=== "TS"
```typescript title="bubble_sort.ts"
[class]{}-[func]{bubbleSortWithFlag}

View File

@ -38,13 +38,13 @@
[class]{}-[func]{bucketSort}
```
=== "JavaScript"
=== "JS"
```javascript title="bucket_sort.js"
[class]{}-[func]{bucketSort}
```
=== "TypeScript"
=== "TS"
```typescript title="bucket_sort.ts"
[class]{}-[func]{bucketSort}

View File

@ -36,13 +36,13 @@
[class]{}-[func]{countingSortNaive}
```
=== "JavaScript"
=== "JS"
```javascript title="counting_sort.js"
[class]{}-[func]{countingSortNaive}
```
=== "TypeScript"
=== "TS"
```typescript title="counting_sort.ts"
[class]{}-[func]{countingSortNaive}
@ -155,13 +155,13 @@ $$
[class]{}-[func]{countingSort}
```
=== "JavaScript"
=== "JS"
```javascript title="counting_sort.js"
[class]{}-[func]{countingSort}
```
=== "TypeScript"
=== "TS"
```typescript title="counting_sort.ts"
[class]{}-[func]{countingSort}

View File

@ -92,7 +92,7 @@
[class]{}-[func]{heapSort}
```
=== "JavaScript"
=== "JS"
```javascript title="heap_sort.js"
[class]{}-[func]{siftDown}
@ -100,7 +100,7 @@
[class]{}-[func]{heapSort}
```
=== "TypeScript"
=== "TS"
```typescript title="heap_sort.ts"
[class]{}-[func]{siftDown}

View File

@ -43,13 +43,13 @@
[class]{}-[func]{insertionSort}
```
=== "JavaScript"
=== "JS"
```javascript title="insertion_sort.js"
[class]{}-[func]{insertionSort}
```
=== "TypeScript"
=== "TS"
```typescript title="insertion_sort.ts"
[class]{}-[func]{insertionSort}

View File

@ -83,7 +83,7 @@
[class]{}-[func]{mergeSort}
```
=== "JavaScript"
=== "JS"
```javascript title="merge_sort.js"
[class]{}-[func]{merge}
@ -91,7 +91,7 @@
[class]{}-[func]{mergeSort}
```
=== "TypeScript"
=== "TS"
```typescript title="merge_sort.ts"
[class]{}-[func]{merge}

View File

@ -69,7 +69,7 @@
[class]{quickSort}-[func]{partition}
```
=== "JavaScript"
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSort}-[func]{swap}
@ -77,7 +77,7 @@
[class]{QuickSort}-[func]{partition}
```
=== "TypeScript"
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSort}-[func]{swap}
@ -163,13 +163,13 @@
[class]{quickSort}-[func]{quickSort}
```
=== "JavaScript"
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSort}-[func]{quickSort}
```
=== "TypeScript"
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSort}-[func]{quickSort}
@ -267,7 +267,7 @@
[class]{quickSortMedian}-[func]{partition}
```
=== "JavaScript"
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSortMedian}-[func]{medianThree}
@ -275,7 +275,7 @@
[class]{QuickSortMedian}-[func]{partition}
```
=== "TypeScript"
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSortMedian}-[func]{medianThree}
@ -361,13 +361,13 @@
[class]{quickSortTailCall}-[func]{quickSort}
```
=== "JavaScript"
=== "JS"
```javascript title="quick_sort.js"
[class]{QuickSortTailCall}-[func]{quickSort}
```
=== "TypeScript"
=== "TS"
```typescript title="quick_sort.ts"
[class]{QuickSortTailCall}-[func]{quickSort}

View File

@ -64,7 +64,7 @@ $$
[class]{}-[func]{radixSort}
```
=== "JavaScript"
=== "JS"
```javascript title="radix_sort.js"
[class]{}-[func]{digit}
@ -74,7 +74,7 @@ $$
[class]{}-[func]{radixSort}
```
=== "TypeScript"
=== "TS"
```typescript title="radix_sort.ts"
[class]{}-[func]{digit}

View File

@ -69,13 +69,13 @@
[class]{}-[func]{selectionSort}
```
=== "JavaScript"
=== "JS"
```javascript title="selection_sort.js"
[class]{}-[func]{selectionSort}
```
=== "TypeScript"
=== "TS"
```typescript title="selection_sort.ts"
[class]{}-[func]{selectionSort}

View File

@ -136,7 +136,7 @@
isEmpty := deque.Len() == 0
```
=== "JavaScript"
=== "JS"
```javascript title="deque.js"
/* 初始化双向队列 */
@ -174,7 +174,7 @@
console.log("双向队列是否为空 = " + isEmpty);
```
=== "TypeScript"
=== "TS"
```typescript title="deque.ts"
/* 初始化双向队列 */
@ -377,7 +377,7 @@
[class]{linkedListDeque}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="linkedlist_deque.js"
[class]{ListNode}-[func]{}
@ -385,7 +385,7 @@
[class]{LinkedListDeque}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="linkedlist_deque.ts"
[class]{ListNode}-[func]{}
@ -486,13 +486,13 @@
[class]{arrayDeque}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="array_deque.js"
[class]{ArrayDeque}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="array_deque.ts"
[class]{ArrayDeque}-[func]{}

View File

@ -130,7 +130,7 @@
isEmpty := queue.Len() == 0
```
=== "JavaScript"
=== "JS"
```javascript title="queue.js"
/* 初始化队列 */
@ -158,7 +158,7 @@
const empty = queue.length === 0;
```
=== "TypeScript"
=== "TS"
```typescript title="queue.ts"
/* 初始化队列 */
@ -328,13 +328,13 @@
[class]{linkedListQueue}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="linkedlist_queue.js"
[class]{LinkedListQueue}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="linkedlist_queue.ts"
[class]{LinkedListQueue}-[func]{}
@ -426,13 +426,13 @@
[class]{arrayQueue}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="array_queue.js"
[class]{ArrayQueue}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="array_queue.ts"
[class]{ArrayQueue}-[func]{}

View File

@ -131,7 +131,7 @@
isEmpty := len(stack) == 0
```
=== "JavaScript"
=== "JS"
```javascript title="stack.js"
/* 初始化栈 */
@ -158,7 +158,7 @@
const is_empty = stack.length === 0;
```
=== "TypeScript"
=== "TS"
```typescript title="stack.ts"
/* 初始化栈 */
@ -330,13 +330,13 @@
[class]{linkedListStack}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="linkedlist_stack.js"
[class]{LinkedListStack}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="linkedlist_stack.ts"
[class]{LinkedListStack}-[func]{}
@ -417,13 +417,13 @@
[class]{arrayStack}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="array_stack.js"
[class]{ArrayStack}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="array_stack.ts"
[class]{ArrayStack}-[func]{}

View File

@ -54,7 +54,7 @@
tree := []any{1, 2, 3, 4, nil, 6, 7, 8, 9, nil, nil, 12, nil, nil, 15}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 二叉树的数组表示 */
@ -62,7 +62,7 @@
let tree = [1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15];
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 二叉树的数组表示 */
@ -149,13 +149,13 @@
[class]{arrayBinaryTree}-[func]{}
```
=== "JavaScript"
=== "JS"
```javascript title="array_binary_tree.js"
[class]{ArrayBinaryTree}-[func]{}
```
=== "TypeScript"
=== "TS"
```typescript title="array_binary_tree.ts"
[class]{ArrayBinaryTree}-[func]{}

View File

@ -71,7 +71,7 @@ G. M. Adelson-Velsky 和 E. M. Landis 在其 1962 年发表的论文 "An algorit
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* AVL 树节点类 */
@ -89,7 +89,7 @@ G. M. Adelson-Velsky 和 E. M. Landis 在其 1962 年发表的论文 "An algorit
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* AVL 树节点类 */
@ -222,7 +222,7 @@ G. M. Adelson-Velsky 和 E. M. Landis 在其 1962 年发表的论文 "An algorit
[class]{aVLTree}-[func]{updateHeight}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{height}
@ -230,7 +230,7 @@ G. M. Adelson-Velsky 和 E. M. Landis 在其 1962 年发表的论文 "An algorit
[class]{AVLTree}-[func]{#updateHeight}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{height}
@ -314,13 +314,13 @@ G. M. Adelson-Velsky 和 E. M. Landis 在其 1962 年发表的论文 "An algorit
[class]{aVLTree}-[func]{balanceFactor}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{balanceFactor}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{balanceFactor}
@ -418,13 +418,13 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{rightRotate}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{#rightRotate}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{rightRotate}
@ -502,13 +502,13 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{leftRotate}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{#leftRotate}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{leftRotate}
@ -607,13 +607,13 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{rotate}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{#rotate}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{rotate}
@ -693,7 +693,7 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{insertHelper}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{insert}
@ -701,7 +701,7 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{#insertHelper}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{insert}
@ -793,7 +793,7 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{aVLTree}-[func]{removeHelper}
```
=== "JavaScript"
=== "JS"
```javascript title="avl_tree.js"
[class]{AVLTree}-[func]{remove}
@ -801,7 +801,7 @@ AVL 树的特点在于「旋转 Rotation」操作它能够在不影响二叉
[class]{AVLTree}-[func]{#removeHelper}
```
=== "TypeScript"
=== "TS"
```typescript title="avl_tree.ts"
[class]{AVLTree}-[func]{remove}

View File

@ -55,13 +55,13 @@
[class]{binarySearchTree}-[func]{search}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search_tree.js"
[class]{}-[func]{search}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search_tree.ts"
[class]{}-[func]{search}
@ -138,13 +138,13 @@
[class]{binarySearchTree}-[func]{insert}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search_tree.js"
[class]{}-[func]{insert}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search_tree.ts"
[class]{}-[func]{insert}
@ -245,13 +245,13 @@
[class]{binarySearchTree}-[func]{remove}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_search_tree.js"
[class]{}-[func]{remove}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_search_tree.ts"
[class]{}-[func]{remove}

View File

@ -56,7 +56,7 @@
}
```
=== "JavaScript"
=== "JS"
```javascript title=""
/* 二叉树节点类 */
@ -67,7 +67,7 @@
}
```
=== "TypeScript"
=== "TS"
```typescript title=""
/* 二叉树节点类 */
@ -257,7 +257,7 @@
n2.Right = n5
```
=== "JavaScript"
=== "JS"
```javascript title="binary_tree.js"
/* 初始化二叉树 */
@ -274,7 +274,7 @@
n2.right = n5;
```
=== "TypeScript"
=== "TS"
```typescript title="binary_tree.ts"
/* 初始化二叉树 */
@ -421,7 +421,7 @@
n1.Left = n2
```
=== "JavaScript"
=== "JS"
```javascript title="binary_tree.js"
/* 插入与删除节点 */
@ -433,7 +433,7 @@
n1.left = n2;
```
=== "TypeScript"
=== "TS"
```typescript title="binary_tree.ts"
/* 插入与删除节点 */

View File

@ -38,13 +38,13 @@
[class]{}-[func]{levelOrder}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_tree_bfs.js"
[class]{}-[func]{levelOrder}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_tree_bfs.ts"
[class]{}-[func]{levelOrder}
@ -140,7 +140,7 @@
[class]{}-[func]{postOrder}
```
=== "JavaScript"
=== "JS"
```javascript title="binary_tree_dfs.js"
[class]{}-[func]{preOrder}
@ -150,7 +150,7 @@
[class]{}-[func]{postOrder}
```
=== "TypeScript"
=== "TS"
```typescript title="binary_tree_dfs.ts"
[class]{}-[func]{preOrder}