{"id":14422,"date":"2016-01-06T18:15:37","date_gmt":"2016-01-06T18:15:37","guid":{"rendered":"https:\/\/www.techopedia.com\/definition\/recursive-loop\/"},"modified":"2018-06-13T11:52:48","modified_gmt":"2018-06-13T11:52:48","slug":"recursive-loop","status":"publish","type":"definition","link":"https:\/\/www.techopedia.com\/definition\/31628\/recursive-loop","title":{"rendered":"Recursive Loop"},"content":{"rendered":"
A recursive loop is said to have occurred when a function, module or an entity keeps making calls to itself repeatedly, thus forming an almost never-ending loop. Recursive constructs are used in several algorithms like the algorithm used for solving the Tower of Hanoi problem. Most programming languages implement recursion by allowing a function to call itself.<\/p>\n
Recursive loops are also known simply as recursion.<\/p>\n
A recursive loop is a special type of looping construct where a particular entity tries to invoke itself from within its loop code. Thus the entity keeps calling itself until a specific condition or break is specified. Recursive loops are usually implemented with the help of a recursive function call where a call to a particular function is placed within the function definition itself.<\/p>\n
The programming languages capable of implementing recursive loops can solve the problems that require the use of iterative structures like "while" and "for" just by using recursive loops alone. Thus recursive loops can replace the traditional loop constructs and are sometimes useful in creating less bulky code. It also simplifies the code and helps in breaking down complex codes into simple statements.<\/p>\n
Some of the most common problem applications of recursive functions include the Tower of Hanoi, computation for series for e = 1\/0! +1\/1!+1\/2+…, computation of gcd, factorial and so on.<\/p>\n
Recursion is also used in cases when the programmer is not sure about the exact size of data.<\/p>\n
Recursion in computing can be classified into the following types:<\/p>\n
Using recursive loops may affect the performance of the program. Recursive loops make use of memory stacks and when the stacks are full, the loop may terminate before the intended termination time.<\/p>\n","protected":false},"excerpt":{"rendered":"
What Does Recursive Loop Mean? A recursive loop is said to have occurred when a function, module or an entity keeps making calls to itself repeatedly, thus forming an almost never-ending loop. Recursive constructs are used in several algorithms like the algorithm used for solving the Tower of Hanoi problem. Most programming languages implement recursion […]<\/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":[244,216],"class_list":["post-14422","definition","type-definition","status-publish","format-standard","hentry","definitioncat-programming-languages","definitioncat-software-development"],"acf":[],"yoast_head":"\n