Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters

Reply
 
Thread Tools

Tail recursion
Old 21.08.2004, 14:41   #1
The Reloaded
 
Aram Hambardzumyan's Avatar
 
Join Date: 01 2002
Location: behind the flesh and gelatinе of soft dull eyes
Posts: 3,387
Rep Power: 5
Default Tail recursion

Tail recursion is when no instruction follows recursive call and calling function returns immediately after it:

int foo(int x)
{
//.............

return foo(x-1);
}

Did you know that there exist stack optimisation opportunities in this case? So if compiler supports it then tail recursion is as 'bad' as iteration

Old 21.08.2004, 18:14   #2
Магистр
 
svoy's Avatar
 
Join Date: 11 2003
Location: heart of europe
Age: 46
Posts: 718
Rep Power: 5
Default

for example JVM(java virtual machine)????
__________________
http://imagegen.last.fm/Geldropdown-...ks/3/svoy1.gif
If you stop, you die! Doc Miles, Crank

Old 22.08.2004, 06:48   #3
The Reloaded
 
Aram Hambardzumyan's Avatar
 
Join Date: 01 2002
Location: behind the flesh and gelatinе of soft dull eyes
Posts: 3,387
Rep Power: 5
Default

maybe, i don't know
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 21:31.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.