What is an algorithm? | Define algorithm | Explain how you can judge an algorithm to be a good one?
Algorithm can be defined as an outline of the essence of procedure represented in step by step instructional manner.
When you implement this algorithm using any programming language, then it is said to be a program. A certain problem can be solved using many different algorithms.
Informally an algorithm is a well-defined computational procedure that takes some value or set of values as input and gives/produces some value or set of values as output. That is an algorithm is a sequence of computational steps that transform the input into the output.
We can also view an algorithm as a tool for solving a well-specified computational problem.
>> Algorithm of Insertion Sort in Data Structure
How can we say that an algorithm is good or not??? For that we have two main characteristics which is the indication of a good algorithm.
Two main characteristics of a good algorithm are:
1. Running Time: A good algorithm should have shortest running time when compared with others.
2. Space Utilization: Lesser the amount of space an algorithm uses, the better.
Many books or authors refer algorithm as Pseudo code.
Pseudo code is a mixture of natural language & high level programming concepts that describes the main ideas behind a generic implementation of a data structure or algorithm.
It is more structured than usual writing style but less formal than a programming language.