Re: Recursion taking up far too much memory... any ideas?
Re: Recursion taking up far too much memory... any ideas?
- Subject: Re: Recursion taking up far too much memory... any ideas?
- From: Daniel Dalquen <email@hidden>
- Date: Wed, 6 Jun 2007 00:15:42 -0400
On 05.06.2007, at 13:29, John Stiles wrote:
most kinds of recursion (particularly tail recursion) can be
converted into non-recursive code
If I remember correctly from my algorithms and data structures
lecture five years ago, ALL recursions can be expressed by a non-
recursive loop structure. Recursion is very nice, because you can
express things very cleanly and create nice-looking code. But
depending on the depth of the recursion, you have a way larger memory
footprint because each call gets its own stack frame.
That said, Sam, if you want to reduce the memory usage of you code,
try re-writing it in a non-recursive way.
Cheers,
Daniel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden