Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For questions about recursion, the practice of calling a method or function from within itself.
1
vote
What are the considerations to determine whether you can use recursion to solve a problem?
If too deep, get rid of the recursion. If shallow, go to 2.
Is this function likely to be a bottleneck of my program? If yes, go to 3. If no, keep the recursion. If unsure, run a profiler. … If function calls take significantly less time than the rest of the function body, it is ok to use recursion. …