43
$\begingroup$

When teaching recursion, what is the best analogy people use to teach the idea of recursion. There are some nice artistic representations

enter image description here

And the idea of repeatedly cutting a phone book or dictionary in half until you find a number/word (basically binary search). The only problem is students don't use phone books/paper dictionaries anymore and the artistic representation doesn't imply an end goal/state.

$\endgroup$
18
  • 7
    $\begingroup$ This is language agnostic, I'm really looking forward to ways for students to grasp the concept of recusion $\endgroup$
    – pluke
    May 23, 2017 at 15:03
  • 10
    $\begingroup$ Wait, what's recursion again? Okay, Google "recursion"... huh, it gives "Did you mean: recursion"? Okay, clicking that... huh, it gives "Did you mean: recursion"? Okay, clicking that... huh, it gives "Did you mean: recursion"? Okay, clicking that... huh, it gives "Did you mean: recursion"? Opps, out of characters - stack overflow! $\endgroup$
    – Nat
    May 23, 2017 at 15:27
  • 6
    $\begingroup$ You may find this discussion helpful. $\endgroup$
    – Miles
    May 23, 2017 at 20:25
  • 3
    $\begingroup$ There is a question about recursion here cseducators.stackexchange.com/questions/17/… $\endgroup$ May 28, 2017 at 16:17
  • 1
    $\begingroup$ curse = to abuse something verbally. recurse = to repeat oneself while abuse something verbally $\endgroup$
    – pojo-guy
    Jul 3, 2017 at 23:43

31 Answers 31

1
2
-1
$\begingroup$

Maybe you can start by showing a clip of Groundhog Day. Explain how his days are constantly in the same loop, and the loop does not end until he "fixes" something.

Which in programming would be considered a base case.

$\endgroup$
1
  • 5
    $\begingroup$ Seems a bit weak, actually. Where is the recursive "call"? Might be better for while loops where you also need a stopping condition. $\endgroup$
    – Buffy
    Sep 22, 2017 at 20:00
1
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.