Algorithms in Data Structure
Algorithm:
An algorithm is a method or process followed to solve a problem.
Algorithms are created independent of understanding language,i.e an algorithm can be implemented in more than one programming language.
Properties of algorithm :-
Eg:
Algorithm to add two number,
Program:-
A computer program can be seen as an instance or concrete representation of an algorithm , in some programming language.
Summary:-
A problem is a function or a mapping of inputs to outputs
An algorithm is a recipe for a solving a problem whose steps are concrete and unambiguous.
The algorithm must be correct of finite length and must terminate all inputs.A program is an instantiate of an algorithm in a computer programming language.
An algorithm is a method or process followed to solve a problem.
Algorithms are created independent of understanding language,i.e an algorithm can be implemented in more than one programming language.
Properties of algorithm :-
- It must be correct.
- It is composed of a series of concrete steps.
- There can be no ambiguity asto which step will be performed next.
- Must be composed of finite number of steps.
- It must terminate.
Eg:
Algorithm to add two number,
- Read a
- Read b
- c=a+b
- display c
Program:-
A computer program can be seen as an instance or concrete representation of an algorithm , in some programming language.
Summary:-
A problem is a function or a mapping of inputs to outputs
An algorithm is a recipe for a solving a problem whose steps are concrete and unambiguous.
The algorithm must be correct of finite length and must terminate all inputs.A program is an instantiate of an algorithm in a computer programming language.
No comments