Couldn't you just allocate a big enough stack to begin with, or allocate chunks of it 
as you go on(initialize and resize array) and get an efficient behavior?

It seems to me that recursion is needed when you you didn't think you would have 
needed it in the first place!!!(design phase)

-----Message d'origine-----
De : Jean-Pierre Drolet [mailto:[EMAIL PROTECTED]
Envoyé : June 4, 2004 9:51 AM
À : Dominic Lavoie; Info-LabVIEW
Objet : Re: Recursive Code Challenge


Salut,

You are right. Formally, recursion can always be emulated with a data stack and a 
while loop.
Using a recursive call, the data stack is managed automatically as data space is 
created for each recursion level. The cost in
LabVIEW is efficiency.

A recursive call makes the code more simple to design. The recursive nature of the 
code is explicit which is not the case with a
while loop.

Other than that, there are no clear advantage for the recusive call.

Jean-Pierre Drolet
www.avensys.ca



----- Original Message ----- 
From: "Dominic Lavoie" <[EMAIL PROTECTED]>
To: "Info-LabVIEW" <[EMAIL PROTECTED]>
Sent: Friday, June 04, 2004 9:15 AM
Subject: RE: Recursive Code Challenge


Salut.

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)?




Confidentiality Warning: This message and any attachments are intended only for the 
use of the intended recipient(s), are confidential, and may contain privileged 
information. If you are not the intended recipient, you are hereby notified that any 
review, retransmission, conversion to hard copy, copying, circulation or other use of 
this message and any attachments is strictly prohibited. If you are not the intended 
recipient, please notify the sender immediately by return e-mail, and delete this 
message and any attachments from your system. Thank you.

Information confidentielle: Le présent message, ainsi que tout fichier qui pourrait y 
être joint, sont envoyés à l'intention exclusive de son ou de ses destinataires; ils 
sont de nature confidentielle et peuvent constituer une information privilégiée. Nous 
avertissons toute personne autre que le destinataire prévu que tout examen, 
réacheminement, impression, copie, distribution ou autre utilisation de ce message et 
de tout fichier qui y est joint est strictement interdit. Si vous n'êtes pas le 
destinataire prévu, veuillez en aviser immédiatement l'expéditeur par retour de 
courriel et supprimer ce message et tout document joint de votre système. Merci.





Reply via email to