Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 56 - 2619_PlusGPT V2.1_C-8
P. 56

    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.

                      54    Premium Edition-VIII

| 51 52 53 54 55 56 57 58 59 60 61 |