mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 11:36:29 +08:00
lint: switch indent type
This commit is contained in:
parent
d3e15a8856
commit
621fcb731c
2 changed files with 5 additions and 11 deletions
|
@ -118,7 +118,7 @@ function factorialRecur(n) {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
let n = 8;
|
const n = 8;
|
||||||
console.log("输入数据大小 n = " + n);
|
console.log("输入数据大小 n = " + n);
|
||||||
|
|
||||||
let count = constant(n);
|
let count = constant(n);
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* File: time_complexity.js
|
* File: time_complexity.ts
|
||||||
* Created Time: 2023-01-02
|
|
||||||
* Author: RiverTwilight (contact@rene.wang)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* File: time_complexity.js
|
|
||||||
* Created Time: 2023-01-02
|
* Created Time: 2023-01-02
|
||||||
* Author: RiverTwilight (contact@rene.wang)
|
* Author: RiverTwilight (contact@rene.wang)
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +20,7 @@ function linear(n: number): number {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 线性阶(遍历数组) */
|
/* 线性阶(遍历数组) */
|
||||||
function arrayTraversal(nums) {
|
function arrayTraversal(nums: number[]) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
// 循环次数与数组长度成正比
|
// 循环次数与数组长度成正比
|
||||||
for (let i = 0; i < nums.length; i++) {
|
for (let i = 0; i < nums.length; i++) {
|
||||||
|
@ -124,10 +118,10 @@ function factorialRecur(n: number): number {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
var n: number = 8;
|
var n = 8;
|
||||||
console.log("输入数据大小 n = " + n);
|
console.log("输入数据大小 n = " + n);
|
||||||
|
|
||||||
let count = constant(n);
|
var count = constant(n);
|
||||||
console.log("常数阶的计算操作数量 = " + count);
|
console.log("常数阶的计算操作数量 = " + count);
|
||||||
|
|
||||||
count = linear(n);
|
count = linear(n);
|
||||||
|
|
Loading…
Reference in a new issue