Definition of algorithm: i n computer science, an algorithm is a series of instructions, for solving problems step by step. The goal of an algorithms is the purpose of an algorithm, in this example it is counting persons in a room. Pseudo code is an english like instruction set the sintaxis that resembles the programing language The variable is the thing that I would like to measure. In this case the variable N is the quantity of persons in the same room. How to test the algorithm ? First, in the line 1 stablish a variable to be measured, in the line 2 is for each person is in the room we count 1, and finally int he line 3 you must say how we are going to count the variable. The loop is a sequence of steps that will be repeated a number of times. Testing algorithm : You must establish if the algorithm works so you bang on it a bit testing corner cases or specific cases. The corner case is a case that is not typical. To te...
Comments
Post a Comment