Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -1,6 +1,6 @@
int fibRec(int n){
if (n < 2)
return n;
else
return fibRec(n - 1) + fibRec(n - 2);
if (n < 2)
return n;
else
return fibRec(n - 1) + fibRec(n - 2);
}

View file

@ -1,16 +1,16 @@
int fibIter(int n){
if (n < 2)
return n;
int last = 0;
int cur = 1;
int next;
for (int i = 1; i < n; ++i){
next = last + cur;
last = cur;
cur = next;
}
return cur;
if (n < 2)
return n;
int last = 0;
int cur = 1;
int next;
for (int i = 1; i < n; ++i){
next = last + cur;
last = cur;
cur = next;
}
return cur;
}