Tail recursive!!!!! 
Author Message
 Tail recursive!!!!!

Please what does it mean tail recursive?
And what is the difference between "recursion" and "tail recursive"

Mehdia

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 05 May 2002 03:00:00 GMT  
 Tail recursive!!!!!

Quote:

>Please what does it mean tail recursive?
>And what is the difference between "recursion" and "tail recursive"

Tail recursion is when the recursive call is the last thing the function
does, i.e. it returns the value that the recursive call returns.  This
permits an optimization: instead of creating a new stack frame for the
recursive call, the frame for the current procedure can be reused.  The
arguments in the call are simply assigned to the current procedure's
parameter variables, and a jump to the beginning of the function is done.
As a result, a tail recursive procedure has the same stack use as an
iterative procedure.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



Sun, 05 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Recursive to tail recursive definitions...???

2. head recursive or tail recursive

3. Converting recursive algorithms to tail recursive algorithms...???

4. Making things tail-recursive...

5. Why Not Tail-Recursive?

6. Tail recursive list building

7. Papers about tail-recursive.

8. What makes an implementation tail recursive?

9. Question about properly tail recursive-ness

10. Java imps not tail recursive

11. Properly tail recursive ?!?

12. SCOOPS method calls (tail-recursive?)

 

 
Powered by phpBB® Forum Software