Page 90 - TP_Pluse_V2.2_Class_6
P. 90

An algorithm is a set of steps in a sequential manner to solve a problem or to complete a task. The
                  problem can be logical or mathematical. Algorithms are the building blocks of computer programs.
                  They are important to programming as recipes are for cooking. An algorithm is always written in

                  very simple words and precise language so that the steps can be understood easily by everyone.
                  In computer terms, 'Algorithm is the sequence of steps or computer operations which collectively
                  solve a given problem'.



                         CHARACTERISTICS OF A GOOD ALGORITHM


                  The main characteristics of a good algorithm are:

                     Precision: Each step is precisely defined.
                     Uniqueness: Result of each step should be uniquely identified and only depend on the result of the

                    preceding step.
                     Finiteness: It should stop after a finite number of instructions are executed.

                     Input: It should have well-defined input.
                     Output: It should have well-defined output.
                                                                               Just as a peacock’s call can signal
                     Effective: It is measured in terms of time and space.    upcoming rain, computer algorithms

                                                                               can predict future events based on
                         USES OF AN ALGORITHM                                            data patterns.



                  An algorithm is commonly used for:
                     Performing data processing

                     Performing computer and mathematical operations

                     Manipulating data
                     Searching for a particular data


                         WRITING AN ALGORITHM


                  The construction of the algorithm is the stage that requires creative thinking and finding the best
                  possible combination of steps to get the result. For example,

                  A. Algorithm to find the product, sum, and difference of two numbers.

                  Step 1:   Start.

                  Step 2:  Read two numbers and store them in A and B.
                  Step 3:  Multiply the two numbers A and B.

                  Step 4:   Print the product.
                  Step 5:  Add the two numbers A and B.


                  88    Plus (Ver. 2.2)-VI
   85   86   87   88   89   90   91   92   93   94   95