The algorithm is a method to analyze a program step by step. In the process, analysis can
be a finite number of steps called algorithms.
The algorithm is a set of well-defined computational procedures it takes some input numbers and gives desired output to the user.
"set of procedures" called an algorithm.
Sometimes algorithms are incorrect and correct
Because algorithms are made by humans it depends on human logic how they mad algorithms.
solving problem algorithms can be different from it
depends on the user and how the user makes an algorithm to solve the problem because solving methods can be different.
That algorithm that takes less time to solve problems is called the "efficient " algorithm.
Let's understand how we use salve problem:
Example 3. Find the greatest between 2 numbers.
Step 1: Start
Step 2: Take 2 numbers as input, say A, B.
Step 3: Check if(A>B)
Step 4: Then A is greater
Step 5: Print A
Step 6: Else
Step 7: Check if(B>A )
Step 8: Then B is greater
Step 9: Print B
Step 10: End
What is the advantage?
1. Using step procedure is make it easy to handle problems.
2. it does not depend on any programming language it is just a step to make the procedure
to handle the manipulation of the algorithm to solve the problem base on the real condition.
3. it is easy to solve a real problem and convert them into many parts that make sense to write in the program
Disadvantages :
1. Some users make the wrong algorithm which can take a lot of time-consuming to solve problems.
2. if you have a large problem to solve, it becomes difficult to find small time complexity.
3. Giving iteration some time are difficult to
handle to make an algorithm.