# Tagged Questions

The tag has no usage guidance.

11k views

### Performance: recursion vs. iteration in Javascript

I have read recently some articles (e.g. http://dailyjs.com/2012/09/14/functional-programming/) about the functional aspects of Javascript and the relationship between Scheme and Javascript (the ...
761 views

### Equal Gifts Algorithm Problem

Problem Link - http://opc.iarcs.org.in/index.php/problems/EQGIFTS It is Lavanya's birthday and several families have been invited for the birthday party. As is customary, all of them have brought ...
16k views

### Can a recursive function have iterations/loops?

I've been studying about recursive functions, and apparently, they're functions that call themselves, and don't use iterations/loops (otherwise it wouldn't be a recursive function). However, while ...
3k views

### Good resources for learning about recursion [duplicate]

Possible Duplicate: Resources for improving your comprehension of recursion? I am a programmer with 2 years experience, and sometimes think I could solve a specific problem with recursion, but ...
6k views

### Are functional languages better at recursion?

TL;DR : Do functional languages handle recursion better than non-functional ones? I am currently reading Code Complete 2. At some point in the book, the author warns us about recursion. He says it ...
4k views

### What's the difference between recursion and corecursion?

What's the difference between these? Recursion Corecursion On Wikipedia, there is little information and no clear code explaining these terms. What are some very simple examples explaining these ...
1k views

### Writing recursive functions

I am having a lot of trouble writing recursive functions related to trees. I can't just use google for these functions as they are not general and I won't be able to use google in an exam setting! Is ...
427 views

### Pseudocode for an echo using recursion [closed]

Using pseudocode, what would the code for an echo using recursion be? UPDATE: Appears I should have been more clear. By echo I mean the pattern sound exhibits when it echos, not echo as in repeatly ...
344 views

### Process arbitrarily large lists without explicit recursion or abstract list functions?

This is one of the bonus questions in my assignment. The specific questions is to see the input list as a set and output all subsets of it in a list. We can only use cons, first, rest, empty?, empty, ...
4k views

### Local Stack vs Call Stack

On the matter of Recursion: When you create a recursive function, you create a call stack. Ok, no problem; However, a comment on this page (look for comments by "LKM") triggered my curiosity (and ...
489 views

### How can I best study a problem to determine whether recursion can/should be used?

In some cases, I fail to see that a problem could be solved by the divide and conquer method. To give a specific example, when studying the find max sub-array problem, my first approach is to brute ...
2k views

### Why don't more languages support recursive/nested comments? [duplicate]

Possible Duplicate: Why do most programming languages not nest block comments? Most languages I've worked with don't have support for recursive/nested comments. Is there any reason why ...
5k views

### How do you work with Asynchronous functions, recursively?

I am currently working on FLEX and have to call a web services. once I have the result, I have to call the web service again, with the previous result as the input. A compounding problem, is that ...
420 views

### Is this the right strategy to convert an in-level order binary tree to a doubly linked list?

So I recently came across this question - Make a function that converts a in-level-order binary tree into a doubly linked list. Apparently, it's a common interview question. This is the strategy I ...
5k views

### Recursion without factorial, Fibonacci numbers etc

Almost every article I can find about recursion includes the examples of factorial or Fibonacci Numbers, which are: Math Useless in real life Are there some interesting non-math code examples to ...
871 views

### Storing hierarchical template into a database

If this title is ambiguous, feel free to change it, I don't know how to put this in a one-liner. Example: Let's assume you have a html template which contains some custom tags, like <text_field /&...
2k views

### Recursion — is it “divide and conquer” or “code reuse”

Recursion -- as we all know -- is one of those problems -- that wrapping your head around feels like achieving a "milestone" in your programming voyage. But when it comes to actually using it in ...
10k views

### How do I explain “Recursion” to a 8 years old kid? [duplicate]

Possible Duplicate: In plain English, what is recursion? What is the best way to explain "Recursion" to 8 years old kid? I tried with the Fibonacci Series but i failed.
10k views

### Advantage or disadvantages between recursive functions and for-loops [duplicate]

Whats the difference between the two procedures? When should I be using a recursive function instead of a normal for-loop?
4k views

### How do I determine the runtime of a double recursive function?

Given any arbitrarily double-recursive function, how would one calculate its run time? For Example (in pseudocode): int a(int x){ if (x < = 0) return 1010; else return b(x-1) + a(x-1);...
13k views

### Understanding Backtracking in C++

I have a good basic understanding of the fundamentals of C++, I also have an understanding of how recursion works too. I came across certain problems like the classic eight queens problem and solving ...
343 views

### Why does the iterative version take longer?

I was looking over at http://programming.lispdream.com/blog/2011/06/recursion-vs-iteration/ and I saw that on his implementation of the recursive and iterative implementations of the factorial ...
1k views

### How do i speedily traverse a file system while extracting/extrapolating various data and provide user feedback?

I'm working on a system file scanner that reveals info about various files (e.g. size, last used, duplicates, etc). Currently I'm traversing the file system once just to get a good measure of the ...
9k views

### What is so difficult about pointers/recursion? [closed]

In the perils of java schools Joel discusses his experience at Penn and the difficulty of "segmentation faults". He says [segfaults are difficult until you] "take a deep breath and really try ...
5k views

### In term of performance : while , for … Loops VS recursion [closed]

What is better for performance to write the loop as linear e.g. for , while or write it as recursion ?
2k views

### Resources for improving your comprehension of recursion? [closed]

I know what recursion is (when a patten reoccurs within itself, typically a function that calls itself on one of its lines, after a breakout conditional... right?), and I can understand recursive ...
58k views

### In plain English, what is recursion?

The idea of recursion is not very common in real world. So, it seems a bit confusing to the novice programmers. Though, I guess, they become used to the concept gradually. So, what can be a nice ...
2k views

### Is recursion an instance of being “too clever” when programming?

I've read several books and learned through experience that optimizing code to the point where it is inscrutable, or coming up with an extremely fast but extremely complex solution to a problem is not ...