What is Algorithm?
Algorithm is a well defined computational procedure that takes some value, or set of values,as inputs and provide some value , or set of value , as output a sequence of computational steps that transform the input into the output.
Problem
|
|
Solution (Algo) The solution is a finite and well defined.
|
|
Implement (In programming Language)
eg:
Add two number()
{
Read a;
Read b;
Return (a+b);
}
1)Time Analysis (How many time to solve the algorithm)
2)Space Analysis (How many space to solve the algorithm)
In first phase design the algorithm then second phase analyze the algorithm and finally chooses the better algorithm them implement this algorithm.
Problem
|
|
Solution (Algo) The solution is a finite and well defined.
|
|
Implement (In programming Language)
eg:
Add two number()
{
Read a;
Read b;
Return (a+b);
}
- Algorithm is programming language independent. read a first number and read second number then return a addition b.
- It is a combination of sequence of finite steps to solve a particular problem.which is design a algorithm.
- It should produce the output within the finite amount of time.
- every statement should be ambiguous.
- Correctness
- It should produce same output for the given input at any point of time.
- Every two steps in the algorithm will be related to each other. all steps are related with each other.
1)Time Analysis (How many time to solve the algorithm)
2)Space Analysis (How many space to solve the algorithm)
In first phase design the algorithm then second phase analyze the algorithm and finally chooses the better algorithm them implement this algorithm.
No comments