menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Fill in the code to complete the following function for computing a Fibonacci number. public static int fib(int index) index == 1) // Base case ________ else // Reduction and recursive calls return fib(index
asked
Sep 4, 2021
214k
views
2
votes
Fill in the code to complete the following function for computing a Fibonacci number. public static int fib(int index) index == 1) // Base case ________ else // Reduction and recursive calls return fib(index - 1) + fib(index - 2).
A. fib(index - 1).
B. fib(index - 2).
C. fib(index - 1) + fib(index - 2)
D. fib(index - 2) + fib(index - 1).
Computers and Technology
high-school
Mislav
asked
by
Mislav
8.1k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
3
votes
Answer:
B
Step-by-step explanation:
its easy just type that in
Chickie
answered
Sep 9, 2021
by
Chickie
7.8k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Aug 14, 2020
205k
views
Fill in the code to complete the following function for computing a Fibonacci number. public static int fib(int index) if (index == 0
Twinsen
asked
Aug 14, 2020
by
Twinsen
7.8k
points
Mathematics
high-school
1
answer
5
votes
205k
views
asked
Nov 27, 2020
113k
views
Fill in the code to complete the following method for computing a Fibonacci number. public static long fib(long index) { if (index == 0) // Base case return 0; else if (index == 1) // Base case return
Yossis
asked
Nov 27, 2020
by
Yossis
7.6k
points
Computers and Technology
high-school
1
answer
2
votes
113k
views
asked
Sep 26, 2024
11.0k
views
a) Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1)=1,Fib(2)=1,Fib(n)=Fib(n−1)+ Fib(n - 2). ( Use only one
Haste
asked
Sep 26, 2024
by
Haste
7.6k
points
Mathematics
high-school
1
answer
2
votes
11.0k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Explain why binary codes are used to represent characters, numbers and symbols :)
If a person sends email from a school computer or a business computer, should that message be considered private? Does the institution or person that owns the computer from which email is sent have a right
Allow the user to enter a series of temperatures in degrees Celsius (C) ter- minated by the input of –999. For each one, find the corresponding tem- perature in degrees Fahrenheit (F). The conversion formula
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org