Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Recursion

Name: Anonymous 2013-09-06 8:28

When to use recursion? What is the cue when you have to use recursion?

Suppose I am to write a program that computes a factorial or checks if a string is a palindrome or prints all numbers from a certain range? I could use loops for those but I could use recursion?

What's the advantage of either? Is there something that recursion could do that loops could not?

Name: Anonymous 2013-09-07 21:58

>>19,20
────┐ ┌────────────┐
└─────┐ ┌─┘ └──┐ HAVE YOU READ
└───────┘ ┌───┐ └──┐ YOUR SICP TODAY ?
│ P │ │
└───┘ │

┌───────┘
──────────────────┐ └──────┐
└─────┐ ┌───┘
└──────┘

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List