Recursion
Recursion is a technique in computer science that allows for a bigger problem to be broken down into smaller similar sub-problems that makes it easier to solve and debug.
Speaking about functions, we call a function recursive if it makes repeated calls to itself. This would typically involve the function having a base
condition and being small enough to magnify itself easily enough to solve the overall problem.
Julia functions can also make recursive calls, just like any other language. Let's take the case of the Fibonacci series, wherein every number in the sequence is the sum of the previous two:
# fibonacci series 1,1,2,3,5,8,13....
So, if you look closely, the number 2
is the sum of its previous two digits 1+1, and then the next number, 3
, is the sum of its previous two, 1+2, and so on. This problem makes a genuine case of recursion.
WHY? Simply because each and every step involves the usage of the same logic being applied, thus the overall sequence can be said to have been created...