puter scientist Niklaus Wirth stated that: Programs = Algorithms + Data The algorithm is part of the blueprint or plan for puter program; an algorithm is: "An effective procedure for solving a problem in a finite number of steps." It is effective, which means that an answer is found and it finishes, that is it has a finite number of steps. A well-designed algorithm will always provide an answer, and it may not be the answer you want but there will be an answer. It may be that the answer is that there is no answer. A well-designed algorithm is also guaranteed to terminate. The key features of an algorithm are: Sequence (also known as Process), Decision (also known as Selection) Repetition (also known as Iteration or Looping) In 1964 the mathematicians Corrado Bohm and Guiseppe Jacopini demonstrated that any algorithm can be stated using sequence, decision and repetition. The work of Bohm and Jacopini was of great importance since it eventually led to the disciplines of structured program design that are much used today. Sequence means that each step or process in the algorithm is executed in the specified order. In an algorithm each process must be in the correct place, otherwise the algorithm will most probably fail. The Decision constructs4If ... then, If ... then ... else ... In algorithms the e of a decision is either true or false, and there is no in between. The e of the decision is based on some condition that can only result in a true or false value[1]. The decision takes the form: if proposition then process A proposition in this sense is a statement, which can only be true or false. It is either true that today is Wednesday or false that today is Wednesday. It can't be both true and false. If the proposition is true then the process, which follows the then, is executed. The decision can also be stated as: if proposition
计算机专业英语教程ch05:Programming Language 来自淘豆网m.daumloan.com转载请标明出处.