The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
1answer
277 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, ...
5
votes
3answers
2k 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 ...
5
votes
3answers
367 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 ...
13
votes
7answers
1k 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 ...
4
votes
2answers
2k 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 ...
4
votes
2answers
349 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 ...
45
votes
18answers
4k 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 ...
3
votes
3answers
570 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 ...
10
votes
6answers
1k 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 ...
14
votes
9answers
4k 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.
3
votes
5answers
5k 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?
15
votes
6answers
2k 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) + ...
11
votes
2answers
5k 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 ...
11
votes
3answers
325 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 ...
4
votes
7answers
721 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 ...
16
votes
10answers
5k 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 ...
8
votes
10answers
3k views

In term of performance : while , for … Loops VS recursion

What is better for performance to write the loop as linear e.g. for , while or write it as recursion ?
9
votes
9answers
899 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 ...
41
votes
18answers
18k 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 ...
7
votes
7answers
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 ...
6
votes
5answers
1k views

Can all the recursive functions be coded with iterations? [closed]

What are the advantages of recursion? Some programming languages can optimize tail recursion, but, still in general terms, recursion consume more resources than regular loops. Is it possible to ...
16
votes
7answers
3k views

What imperative programming languages do not support recursion?

To my knowledge, all modern imperative programming languages support recursion in the sense that a procedure can call itself. This was not always the case, but I cannot find any hard facts with a ...