What is Recursion?

What is Recursion?

CodeIsBae

54 года назад

50 Просмотров

Recursion in computer science is a method of solving a problem where the solution depends on solutions to smaller instances of the same problem. In the context of algorithms, this is achieved using a recursive function.
this is simply a function that calls itself.


Recursion in 4 steps:
1. Identify a base case(s)
2. Build up a recursive case(s)
3. Return output where needed
4. Get closer to base case(s).



Blog: https://www.codeisbae.com
Twitter: https://twitter.com/code_is_bae

Тэги:

#JavaScript #programming #algorithms #data_structures
Ссылки и html тэги не поддерживаются


Комментарии: