Posts

Showing posts with the label computer science

Generate Fibonacci series using recursion with ColdFusion

Image
Recursion is a method which has been popular from the earlier age of computing. In simple terms, recursion is the process in which a function/method calls itself again and again till a condition is satisfied. It is mainly used to generate or find the sum of series of numbers like Fibonacci series. I seldom had chance to implement the recursion in programming. Lately I had to create a dynamic menu structure using Ext JS and I found recursion was the answer. I was able to neatly create the menu dynamically to 'n' levels. As the creation of menu includes Ext JS and other dependencies, I will try to explain the concept with generating Fibonacci series numbers in ColdFusion . As noted before, recursion is the process of a function calling itself again and again. It is infinite, so we will restrict our demo to values till 50 . Let us first look what a fibonacci series is. The series propagates in a manner such that a number in the series is the sum of two preceeding numbers an...