{"id":9878,"date":"2014-12-15T17:04:15","date_gmt":"2014-12-15T17:04:15","guid":{"rendered":"https:\/\/www.techopedia.com\/definition\/tail-recursion\/"},"modified":"2017-05-19T11:26:23","modified_gmt":"2017-05-19T11:26:23","slug":"tail-recursion","status":"publish","type":"definition","link":"https:\/\/www.techopedia.com\/definition\/22460\/tail-recursion","title":{"rendered":"Tail Recursion"},"content":{"rendered":"
Tail recursion is the act of calling a recursive function at the end of a particular code module rather than in the middle. A function is recursive if it calls itself. This programming concept is often useful for self-referencing functions and plays a major role in programming languages such as LISP.\n<\/p>\n
In computer programming, a function that calls itself, either directly or indirectly, is a recursive function. When this call happens at the end of the function, it is called tail recursion. Usually, other calculations or procedures are done before the recursive call.\n<\/p>\n
A tail recursion usually occurs when a recursive function call is made, then ends, and has nothing else to do after having done the recursive call. The benefits of this approach include less burden of retaining a stack frame, as well as code readability. Programmers and designers sometimes use tail recursion in order to optimize code and maximize efficiency.<\/p>\n","protected":false},"excerpt":{"rendered":"
What Does Tail Recursion Mean? Tail recursion is the act of calling a recursive function at the end of a particular code module rather than in the middle. A function is recursive if it calls itself. This programming concept is often useful for self-referencing functions and plays a major role in programming languages such as […]<\/p>\n","protected":false},"author":7813,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_lmt_disableupdate":"","_lmt_disable":"","om_disable_all_campaigns":false,"footnotes":""},"definitioncat":[241,216],"class_list":["post-9878","definition","type-definition","status-publish","format-standard","hentry","definitioncat-computer-science","definitioncat-software-development"],"acf":[],"yoast_head":"\n