mirror of
https://github.com/krahets/hello-algo.git
synced 2025-01-23 22:40:25 +08:00
fix: doesnt return anything
This commit is contained in:
parent
8c736252ab
commit
f83dcce346
@ -24,9 +24,10 @@ class time_complexity {
|
||||
arrayTraversal(nums) {
|
||||
var count = 0;
|
||||
// 循环次数与数组长度成正比
|
||||
nums.forEach(() => {
|
||||
for (var i = 0; i < nums.length; i++) {
|
||||
count++;
|
||||
});
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* 平方阶 */
|
||||
|
Loading…
Reference in New Issue
Block a user