Algorithms, Design Goals, Pseudocode and Implementations
An algorithm is a set of instructions for performing a specific task.
Somewhat more formally, to ensure that we truly do have an algorithm in the strict sense, we require that such a set of instructions also be
When designing an algorithm you should strive to
The term pseudocode refers to a sequence of short English phrases used to describe the steps of an algorithm and formatted in such a way as to make the instructions clearer than they would be without such formatting.
You can also think of pseudocode as an informal "language" used to help programmers develop software. What many inexperienced programmers do not realize about pseudocode is this: If they cannot, or do not, or will not, describe their algorithm in clear and unambiguous pseudocode, the chances of their succeeding in describing it in actual code are very, very small.
The pseudocode for an algorithm is best given in such a way that it is programming-language independent. However, most programmers tend to write pseudocode that reflects their language of choice. This is probably a better alternative than trying to design a new "pseudocode" language and attempting to have everyone agree to write their pseudocode using yet another language.
Any algorithm described by pseudocode can be implemented by any mechanism that can understand and carry out the instructions embodied in that pseudocode.
Thus an algorithm might be implemented by:
And, if an algorithm is implemented by a computer program running on a machine, that algorithm might be written in any number of different programming languages. The only requirement is that the language be expressive enough to be able to describe the steps necessary to perform the steps of algorithm.