At 11:05 AM 12/1/2004 +0000, dipu nandi writeth:
>Hi ,
>       i got through ur question .for calling a function  alot of time su
can use this recursion wheather it depends .by this functin u can reduce ur
lines of codes .again the memory spaces .I am MCA STUDENT OF 1ST yr i am
trying for ur better aswer then......
>                bye

Reducing lines of code and memory usage is not a legitimate reason to use
recursion.  An algorithm should support recursion in the first place to
even consider the approach, but I don't recommend it.  Function calls tend
to be expensive, but so is allocating memory.  A good tradeoff can be made
if fewer calls are made to the memory allocator asking for larger chunks of
memory.  You can really increase performance if you pre-calculate how much
memory you think you need and then allocate it all in one call.  Of course,
with dynamic memory acting as a stack, you have to be careful to not
overflow that (not too hard if someone knows what they are doing).


Thomas J. Hruska
[EMAIL PROTECTED]

Shining Light Productions
Home of the Nuclear Vision scripting language and ProtoNova web server.
http://www.slproweb.com/



To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=:HM/A=2434971/rand=865329665


Yahoo! Groups Links

Reply via email to