The Factorial Recursive Function(英文版)

英文书名:The Factorial Recursive Function
2016-02-19  Tony de Araujo (作者)  
阅读 2388 次  0 条评论


The intent of this 30-page publication is to explain what happens when a function invokes itself and how it calculates the end result of a return statement, like for example, return x * factorial(x-1) When I call this function and ask for the 4 factorial, the function returns the value of 24. If you understand the steps that led to value 24 (how the calculation was made), then you don't need to read this booklet or do the exercises. However, if you are not sure how the above return statement comes up with 24 as a result since there are no obvious calculations in the script, then this booklet might help you grasp the concept. The explanation and exercises are language independent. The examples are written in Go and JavaScript. However, the specific code discussed in the book is universal. Even if you come from another language (or have no programming experience but are curious about the subject) you should not have any problems with it. In fact, you will not be writing code at all since all exercises are done with pen and paper.
0 回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传