+ 1
How may you make understand a new programmer that what is difference between iteration and recursion?Where should he use eith
2 ответов
+ 1
Iteration is a process where a set of instructions are repeated in a sequence of a specified number of times or until a condition is met. When the set of instructions are executed, it is called an iteration or in other words a loop.
Recursion is a technique involving the use of a function that calls itself. That function is called a recursive function.
Recursion is more elegant and easier to spot than iteration solutions but you should take care not to abuse it because complex recursion that is hard to understand should be considered bad practise. Iteration is more efficient because it's doesn't incur of other overhead of multiple method class
+ 1
1+1=2 Thats an iteration
Recursion is a function calling another function
https://code.sololearn.com/castzBfHdCyu/?ref=app