摘要: 大师 L. Peter Deutsch 说过:To Iterate is Human, to Recurse, Divine.中文译为:人理解迭代,神理解递归.毋庸置疑地,递归确实是一个奇妙的思维方式.对一些简单的递归问题,我们总是惊叹于递归描述问题的能力和编写代码的简洁,但要想真正领悟递归的精髓.灵活地运用递归思想来解决问题却并不是一件容易的事情.本文剖析了递归的思想内涵,分析了递归与循环的联系与区别,给出了递归的应用场景和一些典型应用,并利用递归和非递归的方式解决了包括阶乘.斐波那契
To iterate is human, to reverse, divine. // 迭代乃人工, 递归显神通. 虽说如此,但是我们发现很多时候我们用到的是迭代,而不是递归 ??? 举个栗子 1.数组求和 1.1迭代法 1 int sum1(int A[], int n){ 2 int sum = 0; //O(1) 3 for(int i = 0; i < n; i++){ //O(n) 4 sum += A[i]; //O(1) 5 } 6 return sum; //O(1) 7 }
“To Iterate is Human, to Recurs,Divine.” ---L. Peter Deutsch “迭代是人,递归是神” 第一次见有人这样说,让我受伤的心得到些许安慰...... 最近在琢磨算法,又见递归! 这是个绕不过去的坎! 当初,上大学时似懂非懂自欺欺人的蒙混过关,再次引证了那句名言:“出来混,迟早都是要还的......”.好吧,那就直面它!于是搜遍海内外,加上日思夜想,被这“奇技淫巧”折魔得真掉了不少头发(主要是8皇后问题~). 大神王垠在谈程序语言最精华的原理时
1. I wasn't born yesterday.(我又不是三岁小孩) 2. How do I address you?(我怎么称呼你) 3. She turns me off.(她使我厌烦.) 4. So far so good.(目前为止,一切都好.) 5. Be my guest.(请便.别客气) 6. That was a close call.(太危险了/千钧一发) 7. Far from it.(一点也不.) 8. It's a pain in the neck[麻烦的事(人)]
**=================文章====================** Touchy Topics 敏感话题 In North America when people meet each other for the first time, they talk about things like family, work, school or sports. They ask questions like "Do you have any brothers or sisters?&
Molecular Diversity of Midbrain Development in Mouse, Human, and Stem Cells 本文作者的官网:Ventral midbrain 顺便找到了:Download all the data and Python Notebooks from GitHub to reproduce the main figures. GitHub:linnarsson-lab/ipynb-lamanno2016 教程:scRNA-Seq Data
Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human genes and determining their