written 7.9 years ago by | modified 2.8 years ago by |
Mumbai University> FE > Sem 2> STRUCTURED PROGRAMMING APPROACH
Marks: 4M
Year: May 2016, Dec-16
written 7.9 years ago by | modified 2.8 years ago by |
Mumbai University> FE > Sem 2> STRUCTURED PROGRAMMING APPROACH
Marks: 4M
Year: May 2016, Dec-16
written 7.9 years ago by |
An algorithm is a step by step method of solving a problem. An algorithm is a detailed series of instructions for carrying out an operation or solving a problem. Think of it this way: if you were to tell your 3 year old niece to play your favourite song on the piano (assuming the niece has never played a piano), you would have to tell her where the piano was, and how to sit on the bench, and how to open the cover, and which keys to press, and which order to press them in, etc, etc, etc.
The core of what good programmers do is being able to define the steps necessary to accomplish a goal. Unfortunately, a computer only knows a very restricted and limited set of possible steps. For example a computer can add two numbers. But if you want to find the average of two numbers, this is beyond the basic capabilities of a computer. To find the average, you must:
Finiteness: - an algorithm terminates after a finite numbers of steps
Definiteness: - each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion.
Input:- an algorithm accepts zero or more inputs.
Output:- it produces at least one output.
Effectiveness:- it consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time.