Iteration and recursion are very pivotal concepts in understanding the logic and building blocks of all computer programs across all programming paradigms. Although the theory of iteration together with the development and implementation of iterative algorithm is easy to grasp, that of recursion remains elusive to programmers especially novice programmers. In this research, functions composition is applied in the explanation of iteration using recursion. The method demonstrates an easy and elaborate way of writing iterative programs using recursion by identifying the significant variables in both constructs. Function composition is used to write the recursive function, the recursive variable is identified as a variable that converges towards the base case, also the base case is also identified as being the terminating point of the function call else the function call runs and fill the stack memory causing stack overflow. The recursive part is the loop update and base case the termination condition in iterative programs. The results obtained simplifies how to write iterative codes using recursion.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.