Skip to content

Commit 58fac0c

Browse files
author
chufan
committed
docs: 更新算法代码
1 parent 1d4eed0 commit 58fac0c

File tree

7 files changed

+9
-21
lines changed

7 files changed

+9
-21
lines changed

code/algorithm/前端/add.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ function add() {
1111
// 返回函数
1212
return _add
1313
}
14-
1514
// 对参数数组做求和处理
16-
1715
_add.toString = function() {
1816
// 设置sum的起始值为0
1917
return args.reduce((sum, item) => {

code/algorithm/前端/removeWithoutCopy.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
/**
2-
* 移除数组 arr 中的所有值与 item 相等的元素,直接在给定的 arr 数组上进行操作,并将结果返回
3-
* @param arr
4-
* @param item
5-
* @returns {*}
2+
* 移除数组 arr 中的所有值与 item 相等的元素
3+
* - 直接在给定的 arr 数组上进行操作,并将结果返回
64
*/
75
function removeWithoutCopy(arr, item) {
86
// const result= arr.filter(value=>value!==item)
97
// // 输出
108
// return result;
11-
129
// 每次都和arr中的首个元素去比较
1310
const len = arr.length
1411
for (let index = 0; index < len; index++) {

code/algorithm/剑指/二分查找/getNumberOfK.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ function GetNumberOfK(data, k) {
1919
return left === -1 && right === -1 ? 0 : right - left + 1
2020
}
2121

22-
/**
23-
*
24-
* @param data
25-
* @param target
26-
*/
2722
function rightBinarySearch(data, target) {
2823
if (!data.length) {
2924
return -1

code/algorithm/剑指/位运算/findNumsAppearOnce.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function findNumsAppearOnceOne(array) {
3434
*/
3535
function findNumsAppearOnceTwo(array) {
3636
const resMap = new Map()
37-
3837
// 统计
3938
for (const value of array) {
4039
if (resMap.has(value)) {

code/algorithm/剑指/其他相关/add.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
/**
22
* 【简单】不用加减乘除做加法
3-
*/
4-
5-
6-
/**
7-
* 利用自增
3+
* - 利用自增
84
* @param num1
95
* @param num2
106
*/
@@ -28,7 +24,8 @@ function addOne(num1, num2) {
2824
}
2925

3026
/**
31-
* 利用位运算【递归】
27+
* 【简单】不用加减乘除做加法
28+
* - 利用位运算【递归】
3229
* @param num1
3330
* @param num2
3431
*/
@@ -38,7 +35,8 @@ function addTwo(num1, num2) {
3835

3936

4037
/**
41-
* 利用位运算【循环】
38+
* 【简单】不用加减乘除做加法
39+
* - 利用位运算【循环】
4240
* @param num1
4341
* @param num2
4442
* @returns {number}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## MySQL集群部署

docs/manuscript/other/other.sidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export const OtherSidebar = [
1818
{
1919
text: 'Todo计划',
2020
link: 'todo-list'
21-
},
21+
}
2222
]

0 commit comments

Comments
 (0)