tag:blogger.com,1999:blog-5819005.post3256379944697452586..comments2024-03-16T02:17:55.433-07:00Comments on Programming and politics: Tail Recursion in ScalaAnonymoushttp://www.blogger.com/profile/08698131967747444207noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5819005.post-37214537220615072482015-08-23T00:17:31.631-07:002015-08-23T00:17:31.631-07:00int fac(int n,int res)
{if(!n) return 1;
else{
res...int fac(int n,int res)<br />{if(!n) return 1;<br />else{<br />res =res*n;<br />return fac(n-1,res);<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5819005.post-30702577901464761602012-03-21T22:32:19.774-07:002012-03-21T22:32:19.774-07:00These are the nice codes..really too brilliant Tha...These are the nice codes..really too brilliant Thanks for this useful post.web designing companyhttp://www.web-designs-company.comnoreply@blogger.comtag:blogger.com,1999:blog-5819005.post-34401037430556789912009-05-01T18:45:00.000-07:002009-05-01T18:45:00.000-07:00In Scala 2.8 you will be able to assert that your ...In Scala 2.8 you will be able to assert that your code is tail recursive using the @tailrec annotation. I recently wrote a <A HREF="http://blog.richdougherty.com/2009/04/tail-calls-tailrec-and-trampolines.html" REL="nofollow">blog entry</A> that shows how you would use this annotation when writing a tail-recursive factorial.Rich Doughertyhttps://www.blogger.com/profile/05537083862405028266noreply@blogger.com