Articles

Affichage des articles du février, 2016

Indirect Recursion - A Natural Phenomenon

Image
Indirect recursion could be noticed in seeds and trees: a seed ends up to be a tree, and the latter produces many seeds, which themselves become trees and so forth. An interesting case was beautifully described in the Qur'an, chapter 2, verse 261, a plain description that is easy  to represent: " The example of those who spend their wealth in the way of Allah is like a seed [of grain] which grows seven spikes ; in each spike is a hundred grains. And Allah multiplies [His reward] for whom He wills. And Allah is all-Encompassing and Knowing ". ( Source ). Regardless of the religious aspects, one can notice the exponential growth of seeds, which is appreciated in agriculture, but seriously deprecated in Computer Science. If we represent this phenomenon (seeds and spikes) as a Java algorithm: void seed(x) { System.out.println("Seed " + x); for (i = 0; i < 7; i ++) { spike(i); } } void spike(y) { System.out.println("Sp...