To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 4998
4997  |  4999
Subject: 
RE: Would-be hacker queries.
Newsgroups: 
lugnet.robotics
Date: 
Tue, 11 May 1999 22:36:09 GMT
Viewed: 
830 times
  
In lugnet.robotics, rhempel@bmts.com (Ralph Hempel) writes:
You are right, but recursion carries a terrible price in terms of stack
usage.  Most recursion is useful for implementing search and traversal
algorithms, but unless the hardware supports DEEP stacks for the worst
case, the problem is almost always better solved the iterative way...

Don't modern implementations of Lisp/Scheme/Logo automatically convert tail-
recursion into iteration?

--Todd



Message has 1 Reply:
  RE: Would-be hacker queries.
 
(...) Yes, as do decent implementations of traditional compiled languages. For example, GCC converts the following: int f(int v) { if(v<2) return v; return f(v-1); } into int f(int v) { while(v>1) { v--; } return v; } Not terribly useful, but (...) (25 years ago, 11-May-99, to lugnet.robotics)

Message is in Reply To:
  RE: Would-be hacker queries.
 
(...) You are right, but recursion carries a terrible price in terms of stack usage. Most recursion is useful for implementing search and traversal algorithms, but unless the hardware supports DEEP stacks for the worst case, the problem is almost (...) (25 years ago, 11-May-99, to lugnet.robotics)

21 Messages in This Thread:






Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR