Page 106 - Trackpad_V1_Book 6_Flipbook
P. 106

ALGORITHM



                  Before writing a computer program to solve a problem or to perform any task, a programmer
                  writes the steps for the same. Writing a program becomes easy if the algorithm is written first.
                  Algorithms are used in daily lives, too. For example, a recipe detailing steps to create a dish is also
                  an algorithm.
                  An algorithm is a set of instructions or steps in a specific order to solve a problem or to complete

                  a task. In other words, algorithms are the building blocks of computer programs that comprise a
                  sequence of operations  to be performed by the computer in a specific order to solve a problem.





                                 Which algorithm is used by Google Maps?


                  CHARACTERISTICS OF AN ALGORITHM

                  An ideal algorithm has the following characteristics:

                      Input: An algorithm can take input in zeros or greater quantities. It should have well-defined
                      input.

                      Output: At least one result as output is always produced.
                      Definiteness: All instructions given should be clear and easy to understand.

                      Finiteness: It should include a finite number of instructions for completing a task.

                      Effectiveness: It is measured in terms of time and space.
                      Uniqueness: The result of each step should be uniquely identified and only depend on the

                      result of the preceding step.

                  USES OF AN ALGORITHM

                  An algorithm is mainly used for:

                      Calculations
                      Data processing

                      Decision-making

                  Algorithms make decision-making more consistent and efficient.




                             WRITING AN ALGORITHM

                  Algorithm provides a step-by-step solution to the problem. Let’s write an algorithm for some
                  problems.




                  104   Trackpad (Version 1.0)-VI
   101   102   103   104   105   106   107   108   109   110   111