What is Algorithm - Definition, Types and Application
An algorithm can be described as a procedure or formula for problem solving. Algorithms can be widely used in various areas, computer programming, mathematics and daily lives. Then what is the definition of algorithm? How many types are there and in what ways can they be applied?
Definition of Algorithm
Algorithm can be defined as "A sequence of steps to be carried out for a required output from a certain given input". There are 3 main features of algorithm from its definition:
- The essential aim of an algorithm is to get a specific output,
- An algorithm involves with several continuous steps,
- The output comes after the algorithm finished the whole process.
So basically, all algorithms perform logically while following the steps to get an output for a given input.
Types of Algorithm
Algorithms can be classified into 3 types based on their structures:
- Sequence: this type of algorithm is characterized with a series of steps, and each step will be executed one after another.
- Branching: this type of algorithm is represented by the "if-then" problems. If a condition is true, the output will be A, if the condition is false, the output will be B. This algorithm type is also known as "selection type".
- Loop: for this type, the process might be repeatedly executed under a certain condition. It is represented by "while" and "for" problems. But make sure the process will end after a number of loops under the condition. This algorithm type is also known as "repetition type".
Applications of Algorithm
As mentioned before, algorithms can be used in many areas, and they are often represented in flowchart form for visual understanding. In other words, a flowchart is a diagram that represents an algorithm, showing the steps in various boxes and displays the process by connecting the boxes together. Here are some examples for algorithm application in flowchart forms.
1. Algorithm Application for Math
Determine and Output Whether Number N is Even or Odd
2. Algorithm Application for Computer Programming
Draw a flowchart for computing factorial N (N!)
3. Algorithm Application for Daily Life
Determine Whether the Student Passed the Exam or Not
The examples above give a clear demonstration of the applicaitons of algorithms in math, computer programming and daily life. Creating a flowchart might be the best way to represent an algorithm. More examples please refer to the following links:
How to Create an Algorithm?
After knowing the basic concepts of algorithm and its applications, it’s time to create your own algorithm. First, download the software Edraw Max.
Then follow the steps below.
Step 1: After logging in, you can find “flowchart” button. Click it and open a blank page to start creating your algorithm.
Step 2: Select the shapes you need, then drag and drop them to the canvas.
Step 3: Select arrows to represent the direction of the whole process.
Step 4: Fill in the shapes with content.
Step 5: Save or export your algorithm to other file formats
As a matter of fact, creating an algorithm is nothing difficult. All you have to do is follow the rules.