Friday, February 11, 2011

What is The Algorithm..?

The Algorithm: The Basis for All Designs to Solutions of Programming Problems We are almost ready to begin the subject of programming—taking problems in the real world and writing them in a language that the computer can ‘‘understand’’ or execute. Before you get to the stage of programming your problems, you must design a suitable way of solving problems. An algorithm is a set of steps for solving a problem. These steps may repeat and may involve some decisions, such as a choice of two or more things. 

Consider the following example of an algorithm for buying a ticket to a movie.
1. Go to the theatre.

2. Walk to the ticket counter.

3. Select a movie.

4. Pay the price.

5. Receive the ticket.