Skip to main content

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.

Filter by
Sorted by
Tagged with
4 votes
5 answers
206 views

Suggestions to improve my algorithm coding skills

I have a PhD in computer science (A fresh graduate). My bachelor's major is similar to CS but without algorithms (It's a discipline between business and CS). I am quite good at AI research but my ...
Minions's user avatar
  • 141
5 votes
1 answer
166 views

Looking for good Master Theorem examples

I'm teaching an Algorithms class (junior/senior level), and we've just proved the validity of the Master Theorem. I'd like some good questions on it, both for homeworks and for exam questions. Problem ...
Adam Smith's user avatar
67 votes
21 answers
19k 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, ...
Ben I.'s user avatar
  • 33.7k
5 votes
2 answers
1k 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 ...
ItamarG3's user avatar
  • 6,312
7 votes
6 answers
272 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 ...
Ellen Spertus's user avatar
30 votes
13 answers
6k 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 ...
GermaneDork's user avatar
43 votes
31 answers
8k 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 ...
pluke's user avatar
  • 755