Abstract
The design of many tail recursive algorithms can involve thinking about the status of variables and parameters, and how these change with execution flow. In other words, tail recursion is closely related to iteration and imperative programming. However, it is possible to derive tail recursive functions by exclusively using concepts inherent in recursion, such as declarative programming, induction, or problem decomposition. This paper proposes a simple methodology for designing tail recursion functions by using a declarative approach and the concept of function generalization. We have carried out an evaluation of the technique with second and third-year computer science students. Results suggest that this new point of view improves students' ability to design tail recursive programs, helps them understand the distinction between the imperative and declarative paradigms, and may reinforce their programming skills in general. Furthermore, students found the methodology easy to learn and apply, simpler than more sophisticated formal methods, and described it as fast and methodic or mechanical, as it involves a sequence of well-defined steps.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.