代码改变世界

Design and Analysis of Algorithms_Fundamentals of the Analysis of Algorithm Efficiency

2015-05-25 20:46 by 星星之火✨🔥, 1794 阅读, 0 推荐, 收藏, 编辑
摘要:I collect and make up this pseudocode from the book:> _ Anany LevitinNote that throughout the paper, we assume that inputs to algorithms fall within t... 阅读全文

Design and Analysis of Algorithms_Introduction

2015-05-23 21:16 by 星星之火✨🔥, 1250 阅读, 0 推荐, 收藏, 编辑
摘要:I collect and make up this pseudocode from the book:> _ Anany LevitinNote that throughout the paper, we assume that inputs to algorithms fall within t... 阅读全文

从顺序查找窥探平均时间复杂度分析的一般化方法

2015-05-18 19:10 by 星星之火✨🔥, 3325 阅读, 0 推荐, 收藏, 编辑
摘要:顺序查找是在n 个元素的列表中查找一个给定项(或者说查找键)的一个简单的算法。它会检查列表中的连续元素,直到发现了匹配查找键的元素或者到达了列表的终点。我们假设对输入规模为n 的数据做若干次查找,为了分析该算法的平均时间复杂度,还需要对规模为n 的输入做一些假设。标准的假设是:成功查找的概率是P(0... 阅读全文

我的新发现:AVL树旋转的一个特性

2015-05-12 08:40 by 星星之火✨🔥, 734 阅读, 0 推荐, 收藏, 编辑
摘要:关于AVL树旋转的代码网络上铺天盖地。一些经典的实现方法如下:AVLTree SingleLeftRotation(AVLTree A){ AVLTree B = A->left; A->Left = B->Right; B->Right = A; A->Height = M... 阅读全文

欧几里得算法:从证明等式gcd(m, n) = gcd(n, m mod n)对每一对正整数m, n都成立说开去

2015-05-07 19:08 by 星星之火✨🔥, 4167 阅读, 0 推荐, 收藏, 编辑
摘要:写诗或者写程序的时候,我们经常要跟欧几里得算法打交道。然而有没要考虑到为什么欧几里得算法是有效且高效的,一些偏激(好吧,请允许我用这个带有浓重个人情感色彩的词汇)的计算机科学家认为,除非程序的正确性在数学上得到了完全严格的证实,否则我们不能认为程序是正确的。既然存在即合理,因此下面我就详细得解说一下... 阅读全文
上一页 1 2 3 4 5 6 7 8 9 ··· 14 下一页