Should I convert FORTRAN code to C?

00704a-Liber nevin1 at ihlpf.ATT.COM
Fri Jul 15 09:35:29 AEST 1988


In article <901 at garth.UUCP> smryan at garth.UUCP (Steven Ryan) writes:
>I (Nevin Liber) wrote:

>>If you are using an auxiliary stack, then you haven't eliminated recursion,
>>you have just moved it from being implicitly done by the function call

>Recursion usually refers to direct or indirect self-calling. Using an
>explicit auxillary stack with a loop is then elimenating recursion.

I don't buy that.  The 'algorithm' you are using is STILL recursive; all
you have done is change the 'implementation' of the recursion.  If you can
eliminate the stack, then and only then have you eliminated the recursion.

BTW, this is why tail recursion can truly be eliminated.  With tail recursion,
you need not store *any* values (state information) on the stack (because you
never return to it), and the stack is effectively eliminated.
-- 
 _ __			NEVIN J. LIBER	..!att!ihlpf!nevin1	(312) 979-????
' )  )				You are in a twisty maze of little
 /  / _ , __o  ____		 email paths, all different.
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah



More information about the Comp.lang.c mailing list