"Dominic Lavoie" <[EMAIL PROTECTED]> wrote:

>Could someone explain in a simple way what are the advantages of making a
>function recursive >instead of just making the data recursive(arrays or
>strings) and building one function to play with that data(while loops)?

It's about human understanding. A recursive problem can quite simply be
implemented by a recursive algorithme with a function calling itself.
HOWEVER: recursive functions come with a cost, namely that of more resource
demands and with LabVIEW VIs being a little fatter than a typical C function
this cost is accordingly higher. Also while it is simple to implement a
recursive algorithme with recursive functions it is not so simple to
guarantee that such a function will perform properly in all corner cases.

If you implement a recursive algorithme through some sort of stack implementation
for instace, you have to spend more time on initial design and you are usually
forced to think about corner cases at the same time. Such an algorithme has at
least as good changes to actually work, but it presents itself not as naturally
to most people. 

And since most LabVIEW programmers are lazy :-) (including yours personally) they
often feel sorry that recursion does not work as simple as they would like.

Rolf Kalbermatter
CIT Engineering Nederland BV    tel: +31 (070) 415 9190
Treubstraat 7H                  fax: +31 (070) 415 9191
2288 EG Rijswijk        http://www.citengineering.com
Netherlands             mailto:[EMAIL PROTECTED]
 



Reply via email to