Question

2. Which of the following recursive functions, written in a fictitious language, are tail recursive? Select all that are A. f

0 0
Add a comment Improve this question Transcribed image text
Answer #1

In Regular recursion result of each call is pushed onto the stack frame and after the last recursion we get the result. In case of tail recursion we get result from each call i.e. we need not push result of each call to frame for future calculations.

option B is tail recursive

Add a comment
Know the answer?
Add Answer to:
2. Which of the following recursive functions, written in a fictitious language, are tail recursive? Select all that are A. function f(n) ifn<2 else f(n-1) + f(n-2) end If m=0 else B. function g(m...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT