你最喜欢的算法,它教给你的教训 [英] Your favourite algorithm and the lesson it taught you

查看:133
本文介绍了你最喜欢的算法,它教给你的教训的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么算法,教你最大约编程或特定语言的功能?

What algorithm taught you the most about programming or a specific language feature?

我们都曾经有过这样的时刻,所有的突然之间,我们知道,只知道,我们已经学会了根据最后的理解写的程序员几个台阶的进化阶梯的算法未来的重要一课。他的思想和code有魔力的你?

We have all had those moments where all of a sudden we know, just know, we have learned an important lesson for the future based on finally understanding an algorithm written by a programmer a couple of steps up the evolutionary ladder. Whose ideas and code had the magic touch on you?

推荐答案

常规算法:

  • 快速排序(和它的平均复杂度分析),显示随机你输入可以是一件好事;!
  • 在平衡树( AVL树的为例),一个整洁的方式来平衡搜索/插入费用;
  • Dijkstra算法和的福特Fulkerson增上图的算法(我喜欢第二个有很多应用的事实);
  • LZ的*家族的COM pression算法( LZW 为例),数据通信pression听起来有种神奇的我,直到我发现了它(很久以前:));
  • FFT ,无处不在(重新用于很多其他的算法);
  • 单面算法,无处不在的为好。
  • Quicksort (and it's average complexity analysis), shows that randomizing your input can be a good thing!;
  • balanced trees (AVL trees for example), a neat way to balance search/insertion costs;
  • Dijkstra and Ford-Fulkerson algorithms on graphs (I like the fact that the second one has many applications);
  • the LZ* family of compression algorithms (LZW for example), data compression sounded kind of magic to me until I discovered it (a long time ago :) );
  • the FFT, ubiquitous (re-used in so many other algorithms);
  • the simplex algorithm, ubiquitous as well.

数值相关的:

  • 在欧几里德的算法来计算两个整数的最大公约数:第一算法,简洁大方,功能强大的,有很多的概括;
  • 在整数的快速乘法(库利 - 图基的为例);
  • 牛顿迭代颠倒/找到一个根,一个非常强大的元算法。
  • Euclid's algorithm to compute the gcd of two integers: one of the first algorithms, simple and elegant, powerful, has lots of generalizations;
  • fast multiplication of integers (Cooley-Tukey for example);
  • Newton iterations to invert / find a root, a very powerful meta-algorithm.

数论相关的:

  • AGM - 相关算法(的范例):导致非常简单而优雅的算法来计算圆周率(等等),虽然理论是相当深刻(高斯介绍了椭圆函数和模块化的形式从它,这样你就可以说,这催生了代数几何...);
  • 数域筛(整数分解)的非常的复杂,但相当漂亮的理论成果(这也无二 AKS 的算法,这证明了素数是P)。
  • AGM-related algorithms (examples): leads to very simple and elegant algorithms to compute pi (and much more!), though the theory is quite profound (Gauss introduced elliptic functions and modular forms from it, so you can say that it gave birth to algebraic geometry...);
  • the number field sieve (for integer factorization): very complicated, but quite a nice theoretical result (this also goes for the AKS algorithm, which proved that PRIMES is in P).

我也喜欢研究量子计算(绍尔和的德语 - Josza 算法为例):本教你认为开箱

I also enjoyed studying quantum computing (Shor and Deutsch-Josza algorithms for example): this teaches you to think out of the box.

正如你所看到的,我有点偏向数学化的算法:)

As you can see, I'm a bit biased towards maths-oriented algorithms :)

这篇关于你最喜欢的算法,它教给你的教训的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆