Merge tag 'Perfomace' into develop

Fix:Ajuste Performace
This commit is contained in:
Gustavo Rallenson Gonçalves Da Silva 2022-11-01 21:49:09 -03:00
commit e3fcb114f9
2 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,10 @@
export function fibonacci(value) { export function fibonacci(value) {
// implementar logica aqui // implementar logica aqui
if (value <= 1) { const fib = [0,1]
return value; let i = 1
} while (value > fib.length-1){
return fibonacci(value -1 ) + fibonacci(value -2) fib.push(fib[i - 1] + fib[i])
i ++
}
return fib[value]
} }

View File

@ -1,5 +1,6 @@
export function isPrime(value) { export function isPrime(value) {
// implementar logica aqui // implementar logica aqui
if(value === 1){ if(value === 1){
return false return false
}else{ }else{