Page 90 - Plus_V2.2_C6_Flipbook
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.

                     Effective: It is measured in terms of time and space.

                         USES OF AN ALGORITHM


                  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 two numbers A and B.
                  Step 4:   Print the product.
                  Step 5:  Add two numbers A and B.




                  88    Premium Edition-VI
   85   86   87   88   89   90   91   92   93   94   95