Recursion is a mathematical concept that allows you to express the algorithm in the least amount of notation. Like other mathematical forms, calculus and algebra for example, until you know it, it only seems to complicate things. Once you overcome the learning curve, the light goes on and you have a powerful new tool to use for tackling real-world problems. Of course by comparison, recursion is not much of a tool compared to calculus and algebra, but a tool none the less.
Some languages allow for recursive definition of the code, others don't. Either way, it is useful to recognize the recursive nature of the problem and solution, then the algorithm can be anything you like. And it is always possible to make a recursive algorithm have an iterative solution by using a stack. The two implementation choices you have in LV are building a stack using an array or queue, or spawning VIs from templates. Of the two, I prefer the loop with an array shift register. This will execute efficiently and is usually quite easy to write and read. Of course when LV allows for recursive VI calls, that will be even cleaner to write and read, but it is always nice to know how to make the iterative version. Greg McKaskle
