{"title":"用尾递归改进常用教材递归算法","authors":"Sami Ullah","doi":"10.1109/ICRAI57502.2023.10089594","DOIUrl":null,"url":null,"abstract":"Iteration and recursion are two of the important programming techniques used to develop algorithms and software. Recursive programs are generally not considered as advantageous as iterative functions in the introductory curriculum of computer science. This is because the course books focuses primarily on branched top to bottom versions of recursion which is an inefficient way to create algorithms while iterations have low memory overhead. Recursive algorithms calculate values for the same perimeters repeatedly resulting in wastage of processor time and memory. However, different variants of recursions exist such as linear, tail and branched which are hardly mentioned in conventional studies and are more efficient than branched recursive. Like dynamic programming, tail recursion can provide remedy for such redundant processing. This paper will focus on alternative recursive solutions for some of the most popular known mathematical problems such as factorial, Fibonacci and binomial coefficient with same efficiency as iterative code that is widely discussed in the course books.","PeriodicalId":447565,"journal":{"name":"2023 International Conference on Robotics and Automation in Industry (ICRAI)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-03-03","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Improving Popular Textbook Recursive Algorithms with Tail Recursion\",\"authors\":\"Sami Ullah\",\"doi\":\"10.1109/ICRAI57502.2023.10089594\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Iteration and recursion are two of the important programming techniques used to develop algorithms and software. Recursive programs are generally not considered as advantageous as iterative functions in the introductory curriculum of computer science. This is because the course books focuses primarily on branched top to bottom versions of recursion which is an inefficient way to create algorithms while iterations have low memory overhead. Recursive algorithms calculate values for the same perimeters repeatedly resulting in wastage of processor time and memory. However, different variants of recursions exist such as linear, tail and branched which are hardly mentioned in conventional studies and are more efficient than branched recursive. Like dynamic programming, tail recursion can provide remedy for such redundant processing. This paper will focus on alternative recursive solutions for some of the most popular known mathematical problems such as factorial, Fibonacci and binomial coefficient with same efficiency as iterative code that is widely discussed in the course books.\",\"PeriodicalId\":447565,\"journal\":{\"name\":\"2023 International Conference on Robotics and Automation in Industry (ICRAI)\",\"volume\":\"1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2023-03-03\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2023 International Conference on Robotics and Automation in Industry (ICRAI)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/ICRAI57502.2023.10089594\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2023 International Conference on Robotics and Automation in Industry (ICRAI)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICRAI57502.2023.10089594","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Improving Popular Textbook Recursive Algorithms with Tail Recursion
Iteration and recursion are two of the important programming techniques used to develop algorithms and software. Recursive programs are generally not considered as advantageous as iterative functions in the introductory curriculum of computer science. This is because the course books focuses primarily on branched top to bottom versions of recursion which is an inefficient way to create algorithms while iterations have low memory overhead. Recursive algorithms calculate values for the same perimeters repeatedly resulting in wastage of processor time and memory. However, different variants of recursions exist such as linear, tail and branched which are hardly mentioned in conventional studies and are more efficient than branched recursive. Like dynamic programming, tail recursion can provide remedy for such redundant processing. This paper will focus on alternative recursive solutions for some of the most popular known mathematical problems such as factorial, Fibonacci and binomial coefficient with same efficiency as iterative code that is widely discussed in the course books.