The time complexity of the following program is:

int fib (int x) {
if (x < 2)

return 1;

return x times x times fib (Xmur1)
}

what is the time complexity of this program?

Aug.13,2021

it's probably like this (less confident about your math level)
n n ((n Mel 1) (n Mel 1)) ((n Mel 2) (n Mel 2)). 2 2 1
= n! n!
= n! ^ 2

) Every time

n increases by 1, the operation that needs to be added is fixed, so it is linear correlation. The complexity of linear correlation O=kN in the algorithm, k can basically be ignored, so the time complexity we think it is O (n) is fine.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e48e31-4d08a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e48e31-4d08a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?