Editing Algorithm

Jump to: navigation, search

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 6: Line 6:
  
 
===Implementation===
 
===Implementation===
''Implementation'' of an algorithm is the process by which it is translated from its abstract, newly designed form into machine language, which may be directly executed on a computer, and is, more or less, the proper name for what is often called simply ''programming'', although in actual fact a programmer cannot implement without also performing design. This tends to be the longest stage of the design-implementation-analysis process. The abstracted form of the algorithm must first be refined and carefully fleshed out; in particular, the programmer must decide which [[data structure]]s to use, and this often determines the efficiency of the resulting implementation. The algorithm must then be converted into a form that is readable by both humans and computers, the ''syntax'' of a ''programming language''; the algorithm in this form is generally referred to as ''code'', and writing code is colloquially referred to as ''coding''. Finally, some combination of a ''compiler'', ''assembler'', and ''linker'' convert this syntax into a final concrete form, the ''machine code'', which may be directly executed by a computer (often simply called a ''program''). The ''testing'' phase follows; the code will be modified until the resulting program appears correct, sometimes using a tool called a ''debugger'' to help identify errors. The programmer may discover that the algorithm is incorrect and must be redesigned, or that the implementation does not accurately represent the algorithm and the code must be modified.
+
''Implementation'' of an algorithm is the process by which it is translated from its abstract, newly designed form into machine language, which may be directly executed on a computer, and is, more or less, the proper name for what is often called simply ''programming'', although in actual fact a programmer cannot implement without also performing design. This tends to be the longest stage of the design-implementation-analysis process. The abstracted form of the algorithm must first be refined and carefully fleshed out; in particular, the programmer must decide which [[data structures]] to use, and this often determines the efficiency of the resulting implementation. The algorithm must then be converted into a form that is readable by both humans and computers, the ''syntax'' of a ''programming language''; the algorithm in this form is generally referred to as ''code'', and writing code is colloquially referred to as ''coding''. Finally, some combination of a ''compiler'', ''assembler'', and ''linker'' convert this syntax into a final concrete form, the ''machine code'', which may be directly executed by a computer (often simply called a ''program''). The ''testing'' phase follows; the code will be modified until the resulting program appears correct, sometimes using a tool called a ''debugger'' to help identify errors. The programmer may discover that the algorithm is incorrect and must be redesigned, or that the implementation does not accurately represent the algorithm and the code must be modified.
  
 
===Analysis===
 
===Analysis===
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 it 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.
+
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&times;10<sup>9</sup> base pairs, and that the average gene contains 3&times;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&times;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&times;10<sup>9</sup> base pairs, and that the average gene contains 3&times;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&times;10<sup>9</sup> operations will be required, so the biologist will have her result in about three seconds.

Please note that all contributions to PEGWiki are considered to be released under the Attribution 3.0 Unported (see PEGWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)