Re: recursion. was: stack size. should be: on a different list
Re: recursion. was: stack size. should be: on a different list
- Subject: Re: recursion. was: stack size. should be: on a different list
- From: Sean Ahern <email@hidden>
- Date: Fri, 20 Jun 2003 19:56:36 -0700
Markian Hlynka wrote:
> That's as may be, but for some things it just doesn't make sense. Can you
> conceive of writing alpha-beta or iterative deepening search
> non-recursively? It just doesn't make sense, and makes a mess of the
> programming by mixing the algorithm with details of its implementation at
> the lowest level. Fortunately, this doesn't usually seem to be a problem
> [yet] for search algorithms. But I'm sure there are other problems that are
> similar, where doing the recursion "manually" is counter-intuitive and
> counter-productive.
Sure. That makes sense to me. But why should the stack size have to grow so
much? Passing large quantities of data on the stack sounds like a very
inefficient use of resources, especially with the stack limits that we're
discussing. Would it not be better to limit the size of each stack frame
through liberal use of malloc() and friends, thus moving the bulk of the data
to the heap? Such a technique would surely reduce the memory requirements of
a recursive program without having to resort to unintuitive reorganization of
algorithms.
(We should probably move this discussion off the x11-users list, as it is very
far from topical at this point.)
-Sean
__
email@hidden
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.