Wednesday, 1 February 2017

Algorithm Q.Define algorithm and state properties of it?
Algorithm is a finite set of instructions that,if followed accomplishes a particular task.

Algorithm should satisfy the following criteria:-
1.Input:Zero or more quantities are externally supplied.
2.Output:At least one quantity is produced.
3.Definiteness:Each instruction is clear and unambiguous.Ex.:Add B or C to A.
4.Finiteness:Algorithm should terminate after finite number of steps when traced in all cases.Ex.:Go on adding elements to an array.
5.Effectiveness:Every instruction must be basic i.e.,it can be carried out,by a person using pencil and paper

Algorithm must also be general to deal with any situation.

No comments:

Post a Comment