时间复杂度
O(1)
const n = 1000
console.log(n)
O(n)
for (let i = 1; i <= 10; i++) {
console.log(i)
}
O(n²)
for (let i = 1; i <= 10; i++) {
for(let j = i + 1; j <= 10; j++){
console.log(i,j)
}
}
O(log(n))
for (let i = 1; i < n ; i = i * 2) {
console.log(i)
}
O(k^n)
function fib(n) {
if(n < 2) return n
return fib(n-1) + fib(n-2)
}