Definition of algorithm
Algorithm: In computer science a algorithm is a set of instructions for solving a problem step by step.
Definition of the goal: For solve a problem, for example, count people in a room.
Pseudo code: Is a program language.
Definition of variable: You must to select a variable, for example a letter.
Definition of loop: A sequenst of steps that will repeat some numbers of time.
How to make a algorithm: We count people in a room, you must to select a default variable (n=0) than for each person in the room, increment by 1 person.If are two persons, in the first trip increment 1 and in the next trip, increment 1 and we have 2, and so, by these algorithm end in 2.
testing algorithm : if you will count people in a room, and in these room are 5 people, the result of the algorithm is 5. If are other result, the algorithm is wrong.
we test corner case: when in a room are 0 people, the line 3 doesn't execute and the result is 0.
Definition of branch: Is a extra line that you use when is a extra person.
And that is the Definition of a Algorithm.

Comments
Post a Comment