Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [recursion]

For question about the concept of a function calling itself, also known as recursion. It can also be used for recursive algorithms.

64
votes
21answers
13k views

What are good examples that actually motivate the study of recursion?

One of the traps of imperative-first is how difficult it becomes to help students make sense of recursion when they finally encounter it. And if those kids are fairly competent iterative programmers, ...
5
votes
2answers
321 views

Testing students on recursion - tracing by hand

After learning recursion in class, students take a test (a few lessons for teaching the subject, and then a test), and are then given a grade. The test is on paper, and I can't change that fact. All ...
7
votes
6answers
232 views

Where can a student independently learn elementary recursion, preferably in Java?

Normally, Java 2 is a prerequisite for my Computer Architecture course. I gave permission to a strong student who has only taken Java 1 to take Computer Architecture, provided that she learn the ...
25
votes
13answers
2k views

How to respond when students ask “is recursion good practice”?

Context: CS1-style, intro programming class, using an interpreted language (Python). I will get a hand raised asking "Why are we learning recursion? Is it good programming practice?" My response is ...
35
votes
28answers
3k views

Analogy for teaching recursion

When teaching recursion, what is the best analogy people use to teach the idea of recursion. There are some nice artistic representations And the idea of repeatedly cutting a phone book or ...