Consider the following function to calculate the nth Fibonacci number:long fib (long num){ if (num == 0 || num == 1) return num; return (fib (num - 1) + fib (num - 2));}How many calls does it take to determine fib(4)?
A. 5
B. 9
C. 15
D. 25
Answer: B
You might also like to view...
After executing the following code, what is the value of posOrNeg (assume the number currently has a value of -2)?
if (number >=1) posOrNeg = “pos”; if (number ==0) posOrNeg = “zero”; else posOrNeg = “neg”;
Data ________ is created through repetition and causes inefficiencies
Fill in the blank(s) with correct word
Which of the following types of computers targets a specific audience and offers high-quality audio, video, and graphics with optimal performance for sophisticated single-user and networked or Internet multiplayer games?
A. multiplayer B. gaming desktop C. handheld D. encapsulated
The __________ phase of the SecSDLC has team members create and develop the blueprint for security and develop critical contingency plans for incident response.
A. investigation B. analysis C. implementation D. design