|
-
Dec 5th, 2016, 03:18 PM
#4
Re: Recursion
However, if you make the initial argument large enough, you'll STILL get an exception overflow, which is an issue with recursive functions: They can be cool, but there is always a number of nested recursions above which you can't go, and that limit will be system specific. For this reason, I tend to avoid recursive functions where I can. They usually aren't all that efficient anyways, which is why you asked the second question: A formula that will give you the answer for all N is going to be superior to a recursive function in every case.
Figuring out that function might be kind of hard. A function that includes a condition is likely to be a bit hard to figure out.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|