Editing Algorithm
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 14: | Line 14: | ||
==Importance== | ==Importance== | ||
− | Among factors that determine a program's efficiency, the choice of the underlying algorithm and the data structures used to implement | + | Among factors that determine a program's efficiency, the choice of the underlying algorithm and the data structures used to implement stand out above all others in importance. In the early days of computing, the increase in speed and power of computing machines, exponential as it was, was vastly outpaced by the growth in knowledge of algorithms, allowing large problems to be solved quickly on modestly powered hardware. This trend continues to this day. |
Here is an example. Assume that the human genome numbers approximately 3.3×10<sup>9</sup> base pairs, and that the average gene contains 3×10<sup>4</sup> base pairs. Suppose that we wish to set up a web server that will allow biologists to search for genes in the human genome. Using a naive <math>O(nm)</math> time algorithm for [[string searching]], approximately 10<sup>14</sup> operations would be required to search for a gene inside the human genome. If our web server can execute 10<sup>9</sup> operations per second, it may take up to 10<sup>5</sup> seconds to answer a single query (that is, more than a day). On the other hand, if we use the <math>O(n+m)</math> [[Knuth–Morris–Pratt algorithm]], only about 3.3×10<sup>9</sup> operations will be required, so the biologist will have her result in about three seconds. | Here is an example. Assume that the human genome numbers approximately 3.3×10<sup>9</sup> base pairs, and that the average gene contains 3×10<sup>4</sup> base pairs. Suppose that we wish to set up a web server that will allow biologists to search for genes in the human genome. Using a naive <math>O(nm)</math> time algorithm for [[string searching]], approximately 10<sup>14</sup> operations would be required to search for a gene inside the human genome. If our web server can execute 10<sup>9</sup> operations per second, it may take up to 10<sup>5</sup> seconds to answer a single query (that is, more than a day). On the other hand, if we use the <math>O(n+m)</math> [[Knuth–Morris–Pratt algorithm]], only about 3.3×10<sup>9</sup> operations will be required, so the biologist will have her result in about three seconds. |