What is Algorithm Definition and Introduction
What is Algorithm
Algorithm (Eng. “Algorithm”) is seen as an important topic in Computer Science. Because its use helps developers to develop highly efficient and error free programs.
The word Algorithm refers to the ‘Series of Steps’ which are responsible for completing or executing a particular computation or task. Next we will understand the definition of algorithm in more detail.
It was originally developed to solve mathematical problems. But at present the term is strongly associated with Computer Science. What is you algorithm in next post? (What is Algorithm) will understand with example.
Topics
- Definition of ‘algorithm’
- Who is the founder of algorithm?
- Properties of Algorithms
- Examples of Algorithms
- Types of Algorithms
- in short
Definition of ‘algorithm’
Algorithm is a set of instructions that defines the complete procedure to solve a problem. Its main goal is to get the expected output. It consists of several continuous steps, only after the completion of which the output comes.
This can be understood with the example of making a cup of tea:
Step 1. Fill the kettle with water
Step 2. Boil the water
Step 3. Put the tea leaves in the kettle
Step 4. Add grated ginger.
Step 5. Add one and a half teaspoon sugar
Step 6. Let the Tea Cook
Step 7. Strain the tea and pour it into the cup.
Just like to make a cup of tea, we have to execute the above mentioned steps in turn. In the same way, in programming, algorithms are written to perform any process or task, so that the desired result can be obtained.
It is used in many different fields, the main ones being computer science and mathematics. For example, Search Algorithm, it is a step by step process that is used to retrieve web-pages stored within the data structure.
Apart from this, Encryption Algorithm, is a mathematical procedure, using which a data or message is encoded so that it is difficult to read or understand. Using such algorithms, the data is kept out of reach of unauthorized users.
Who is the founder of algorithm
It has a long history, but the actual word “algorithm” was first introduced in the 9th century. The Persian mathematician of the time, Abu Abdullah Muhammad ibn Musa Al-Khwarizmi is considered its founder. He is also known as the Father of Algebra.
In fact, Al-Khwarizmi was built on the work of Brahmagupta. Brahmagupta was a great Indian mathematician and astronomer. These two great men rose to prominence when the term ‘Algorism’ was used to refer to Latin translations of their arithmetic rules using Hindi-Arabic numerals.
After this the word ‘Algorism’ became the modern “Algorithm” around the 18th century. In its modern form, it is used to solve the problems of daily life apart from areas like Calculation, Data Processing and Programming. So the word algorithm is that step by step process, which is created to solve a problem or task.
Properties of Algorithm
We cannot call any process an algorithm. Rather the algorithm should be useful i.e. it should solve the problem. For this to happen, an algorithm has some properties. That is, it should satisfy the following criteria as mentioned below:
1) Input: An algorithm should have well-defined inputs. Input is the data or information that we enter to provide output.
2) Output: It should produce output. That is, the right solution to the problem should be provided.
3) Unambiguous: Every instruction or step written should be clear. The input/output of each step should also be clear.
4) Finiteness: It means, that the steps written in the algorithm must be terminated after a finite number of steps. Finished means you should get the expected output and not continue in the processing loop.
5) Effectiveness: The algorithm should be practical, so that it is possible to execute the instructions with the available resources. That is, there should not be any unnecessary instructions in it which would make it ineffective.
6) Language Independent: The instructions should be written in simple language only. Which can be implemented in any programming language.
Examples of Algorithms
Various methods are used to write algorithms. Let us understand this with the simplest example.
Example 1– Calculating the average for 3 numbers.
Algorithm:
Step 1. Start
Step 2. Read 3 numbers A, B, C
Step 3. Calculate the average by the equation
Average = (A+B+C)/3
Step 4. Display Average
Step 5. Stop
Example 2– Find the largest among three different numbers entered by user.
Algorithm:
Step 1. Start
Step 2. Declare variables a,b and c
Step 3. Read variables a,b and c.
Step 4. If a > b
If a > c
Display a is the largest number.
Else
Display c is the largest number.
Else
If b > c
Display b is the largest number.
Else
Display c is the greatest number.
Step 5. Stop
Does it satisfy the criteria of being an algorithm:
- In an algorithm the input and output are well defined.
- Each step is depicted in a clear and precise sense.
- There is a finite number of steps. That is, the algorithm ends after a time.
- The algorithm produces an expected output. We get the correct result in the end.
Types of Algorithm
Although there are many types of it, but the most basic types are mentioned below.
- Simple Recursive Algorithms
- Backtracking
- Divide and Conquer
- Dynamic Programming Algorithm
- Greedy Algorithms
- Branch and bound Method
- Brute Force Algorithms
- Randomized Algorithms
In short
Writing a logical step-by-step method to solve a problem is called an algorithm. In very simple language, algorithm is like a plan to solve a problem. Generally this term is used to solve mathematical and computational problems.
It includes calculations, reasoning and data processing. There are many ways to write an algorithm. Once we have the algorithm for a problem, then we can execute it. It can be presented in simple English language, Pseudocode and Flowcharts.
So hopefully, what is this post algorithm? By reading What is Algorithm, you must have come to know about it. If you have any question or suggestion related to the topic, please let us know by commenting below. If you found the information informative, do not forget to share it.