Algorithms are: Definition, types, and examples
the algorithm is
In the world of computing, there are different types of terms, for example, machine learning, AI, cloud, among others. One of the things I've been hearing a lot lately is algorithms.
Basically, an algorithm is a series of instructions aimed at a computer to turn a series of facts into useful information where the algorithm comes from the word algorism and rhythmic which was first introduced by Abu Jafar Muhammad in 825 ad.
Maybe you've heard the term algorithm in everyday life. For example, when you watch YouTube there is an algorithm so that you watch some videos that have been recommended. The recommendations are already based on your experience watching previous videos.
Contents hide
1 What Is An Algorithm?
2 Types Of Algorithms
2.1 1. Recursion
2.2 2. Divide and Conquer
2.3 3. Dynamic Programming
2.4 4. Greedy
2.5 5. Brute Force
2.6 6. Backtracking
3 Examples Of Algorithms
3.1 1. Narrative Algorithm
3.2 2. Algorithm 5 Dragon
3.3 3. Flowchart Algorithm
What Is Meant By Algorithm?
the algorithm is
If you ask what an algorithm is, in general, an algorithm is a collection of sequential steps to solve a particular problem. In computing, an algorithm is a series of sequential steps based on special Systematics to come up with a computational solution.
The development of technology today has allowed humans to produce a complex and sophisticated work.
Although computers can perform calculations faster than humans, but the computer can not work without human intervention to sort the algorithm that has been determined in advance.
It provides an explanation of the understanding of the algorithm is as a number of systematic steps used to solve a particular problem. The problem also applies in the use of computers where the entire logical order that has been arranged into a sequence of certain learning systems can be used in solving problems.
An algorithm is a limited and specialized set of instructions used to compute a function that, when executed, can produce a certain output, and stop at a predetermined termination.
An algorithm is a method that has been carefully planned, so it is properly organized. Its use is usually to solve problems by giving instructions to become an action.
In this all-digital era, understanding algorithms is important, such as articles that continue to appear in Google's Search Engine page rank.
Types Of Algorithms
the algorithm is
When viewed from its function, there are 6 (six) types of basic algorithms, including the following.
1. Recursion
Recursion is an algorithm that works by calling it repeatedly until the problem can be solved. For example, the code to find the factorial is:
Fact (y)
If y is 0
return 1
return(y*Fact (y-1))/* this is where the recursion happens”/
2. Divide and Conquer
This algorithm divides a big problem into smaller problems. Divide and conquer algorithms are divided into two parts, including to solve the problem into several smaller independent sub-problems of the same type, and to find the final solution of the original problem after successfully solving smaller problems separately.
3. Dynamic Programming
Dynamic programming algorithms work by remembering the results of past processes and then using them to find new results. That is, these programming algorithms are dynamic for solving complex problems.
The trick is to solve it into several simple sub problems, then solve each one once. Then save it for future use.
Examples of dynamic programming algorithms are as follows.
Fibonacci (N) = 0 (for n = 0)
=0 (for n=1)
=Fibonacci (N-1) + Finacchi (N-2)
4. Greedy
Greedy algorithm is an algorithm that can solve optimization problems where you can find optimal solutions without having to pay attention to what the consequences will be in the future.
5. Brute Force
Brute Force algorithm is an algorithm that has the simplest concept, which can iterate all possible solutions to find one or more than one solution to solve a problem.
6. Backtracking
Backtracking algorithms are techniques used to solve problems recursively. Then try to get a solution to the problem by solving one problem at a time. If one solution fails, you can delete it to find another solution.
That is, backtracking helps solve sub-problems, but when it fails then this algorithm instantly cancels the last step. Then restart it to find the solution.
Examples Of Algorithms
Basically, algorithms are techniques that are not only used in Computer Science and mathematics, but also in various human daily activities. But as an example of an algorithm this time it deals with programming.
1. Narrative Algorithm
Suppose you are given the name and grade data of a student. If the score of the student is greater than or equal to 65, the student is declared to have passed the exam. While if the value is lower than 65, otherwise not pass the exam.
So the algorithm becomes, if the value > 65 then the description is passed, if the value < 65 otherwise not passed.
2. Algorithm 5 Dragon
The 5 Dragon algorithm is used for certain games in order to win or get a jackpot. If the game has wild items lined up in 3 columns, you can play slotter,
Scatter 5 dragon algorithm allows you to bet as much as 2 M or slotter can be played according to ability. Further round spin, spin the auto spin as much as 10 times, lock the first spin on the number 10 to be able to find a prize, then 5 of a kind or others.
If the round releases a prize, the slotter must play it 100 times and for the bet value you can increase according to ability.
You can play it at 17.00 to 18.00 WIB to get a good room and easily get the jackpot.
3. Flowchart Algorithm
the algorithm is
This algorithm will make it easier for programmers to design computer programs. Here are examples.
First, determine odd or even. For example,there are integers with 0,1, -1 and so on, while the natural numbers are 1,2,3,4,5 and so on. Well, both types of numbers are often used for calculations.
An even number is an integer that will run out or have no remainder when divided by two. While odd numbers are integers that cannot be divided by two, or there are still divisions left.
Second, the leap year algorithm. Leap year is a year that has an extra day in order for the calander to adjust astronomy. In a leap year, February has 29 days. A year that can be divided by four is called a leap year.
Third, the calculation of the price paid when getting a discount. Furthermore, to determine the amount of fees that must be paid by the buyer after getting a 10 percent discount. This requirement can be obtained if you reach a purchase with a total of 1,500,000.
The amount of goods purchased has a dynamic nature, depending on the products purchased by consumers. But in essence, the total purchase that does not reach 1,500,000 then can not get a discount.
An algorithm is a systematic step to solve a problem. The explanation is complete with types and examples so that you can understand well.
Interested in algorithm courses, check the promo at Coding Studio
Comments