Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

difference between recursion and iteration

OpenStudy (anonymous):

A recursive function works through the process of calling itself until a condition is met. An iteration uses a looping control structure (while, do while, for) to repeat a section of code until a condition is met. This is the simple difference between them :)

OpenStudy (anonymous):

It's worth pointing out that theoretically they are equivalent. There is a way to convert iterative code to recursive, and vice versa. In industry, many companies disallow the use of recursion because of the danger of stack overflow crashes. The structure of the problem will dictate which way of solving it is easier.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!