We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is an Algorithm?

By Brendan McGuigan
Updated: May 16, 2024
Views: 330,760
Share

In its most general sense, an algorithm is any set of detailed instructions which results in a predictable end-state from a known beginning. Algorithms are only as good as the instructions given, however, and the result will be incorrect if the algorithm is not properly defined.

Examples of Algorithms

A common example of an algorithm would be instructions for assembling a model airplane. Given the starting set of a number of marked pieces, one can follow the instructions given to result in a predictable end-state: the completed airplane. Misprints in the instructions, or a failure to properly follow a step, will result in a faulty end product.

A computer program is another pervasive example. Every computer program is simply a series of instructions, which may vary in complexity, and is listed in a specific order, designed to perform a specific task. Mathematics also uses algorithms to solve equations by hand, without the use of a calculator. One last example is the human brain: most conceptions of the human brain define all behavior — from the acquisition of food to falling in love — as the result of a complex algorithm.

Classes of Algorithms

While there is no universally accepted breakdown for the various types of algorithms, there are common classes that algorithms are frequently agreed to belong to. Among these are:

  • Dynamic Programming Algorithms: This class remembers older results and attempts to use this to speed the process of finding new results.
  • Greedy Algorithms: Greedy algorithms attempt not only to find a solution, but to find the ideal solution to any given problem.
  • Brute Force Algorithms: The brute force approach starts at some random point and iterates through every possibility until it finds the solution.
  • Randomized Algorithms: This class includes any algorithm that uses a random number at any point during its process.
  • Branch and Bound Algorithms: Branch and bound algorithms form a tree of subproblems to the primary problem, following each branch until it is either solved or lumped in with another branch.
  • Simple Recursive Algorithms: This type goes for a direct solution immediately, then backtracks to find a simpler solution.
  • Backtracking Algorithms: Backtracking algorithms test for a solution; if a solution is found the algorithm has solved, if not it recurs once and tests again, continuing until a solution is found.
  • Divide and Conquer Algorithms: A divide and conquer algorithm is similar to a branch and bound algorithm, except it uses the backtracking method of recurring while dividing a problem into subproblems.

Serial and Parallel Algorithms

In addition to these general classes, algorithms may also be divided into two primary groups: serial algorithms, which are designed for serial execution, wherein each operation is enacted in a linear order; and parallel algorithms, used with computers running parallel processors, wherein a number of operations are run parallel to each other. Parallel algorithms also exist in the natural world in the case of, for example, genetic mutation over a species.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
By anon343469 — On Jul 30, 2013

Can I get a difference between an algorithm and a class in pictures and explanations please?

By anon330226 — On Apr 15, 2013

What are three ways to write algorithms and three types of instruction?

By anon303732 — On Nov 16, 2012

What are the criteria someone needs to use in executing a problem in a flowchart or algorithm?

By anon278068 — On Jul 04, 2012

I did not realize an algorithm was essentially a flow chart.

By anon277917 — On Jul 03, 2012

response 251646: Good example that can be reversed. Some people and animals are tired and need body movement to energize and thus become really tired and sleep well.

By anon275709 — On Jun 19, 2012

Isn't religion an algorithm of preferred response?

By anon258692 — On Apr 03, 2012

sql statements are algorithms.

By anon251464 — On Mar 01, 2012

Example of algorithm:

Are you tired?

Yes: Go to bed

No: Ride a bike

Are you tired?

Yes: Go to bed

No: Ride a bike

By anon206605 — On Aug 17, 2011

I am a school girl and need info on an algorithm for using a CD (for my project). Your post was very useful.

By anon167803 — On Apr 14, 2011

What is the importance of algorithms?

By anon162211 — On Mar 22, 2011

write an algorithm for a program that prompts the user to enter five test scores, calculate the total of the five tests and find the weighted average of each test assuming that each tests weighs 20 percent.

By anon159439 — On Mar 12, 2011

Can you give the difference between the brute-force algorithm and the greedy algorithm?

By anon120879 — On Oct 22, 2010

Can you give an example of an algorithm please?

By anon114385 — On Sep 28, 2010

what is the difference between an algorithm and pseudocode? please explain with examples.

By anon108198 — On Sep 01, 2010

I just want to know the steps in creating an algorithm.

By anon99972 — On Jul 28, 2010

An algorithm is like a predetermined pattern to be followed for a predetermined result. A common algorithm of a rubik's cube is down, left, up, side. Obviously, it is much more complex to solve the rubik's. There are about 5-6 algorithms to follow. Hope this helps.

By anon90999 — On Jun 19, 2010

what is an algorithm? is it related to computer programming?

By anon84157 — On May 13, 2010

What are properties of an algorithm?

By anon79694 — On Apr 23, 2010

What mathematics course do I start learning Algorithms in? sorry for asking but I am currently studying computer networking but I do not have the math skills needed yet. So I haven't got the chance to learn about them.

By anon74204 — On Mar 31, 2010

How do you write an algorithm to input the price of a text book and then calculate the price and print the total cost of the book after 15% VAT is added?

By anon63492 — On Feb 02, 2010

can you explain algorithms and give examples please?

By anon56603 — On Dec 16, 2009

Given a problem (i.e. a question, such as "What is 2+2?" or "What are the prime factors of 1729?") an algorithm is a description of a method for a computer to answer that problem.

Another way to think of it is that some mathematical proofs (e.g. the proof of the Chinese Remainder Theorem) are "constructive"; they give procedures for calculating the values which satisfy the theorem. Such procedures, if they can be expressed to a computer, are in fact algorithms.

By anon53298 — On Nov 20, 2009

what are the properties of an algorithm?

By anon50377 — On Oct 28, 2009

Why can algorithms be known as steps? It is because i'm doing a science project which i have to devise an algorithm to figure out a rubiks cube. Is it possible? what is it?

By anon49579 — On Oct 21, 2009

Big words. Couldn't it be known just as processes?

By anon47896 — On Oct 08, 2009

what is an algorithm? is it different from pseudo-code in any way?

By anon44686 — On Sep 09, 2009

I want to know some basic tips how to learn brute force algorithm for biology and something about time complexity. Can any one answer this.

By anon44430 — On Sep 08, 2009

I want to learn about algorithms. Can you give detailed information of algorithms?

By anon40222 — On Aug 06, 2009

is algorithm really a challenage for me as a programmer? is algorithm really that hard to understand?

By esha3181 — On Jul 03, 2009

Can you please tell me which is the course for learning cryptography?? im a commerce graduate and how do i start learning algorithms?? base content for a beginner like me. Please advise.

By tealann — On May 04, 2009

please give an example of an algorithm

By shakirah — On Feb 05, 2009

What are the principles of algorithm designs?

By Lennox — On Nov 25, 2008

Why are non-linear algorithms superior to linear ones when working with self-learning optimization?

By anon21204 — On Nov 12, 2008

can you give an example of algorithm?

By anon7048 — On Jan 16, 2008

Can you give an example of algorithm?

By anon5151 — On Nov 15, 2007

what is/are the criteria of an algorithm??

By anon4611 — On Oct 25, 2007

Can you give an example of an algorithm please?

Share
https://www.easytechjunkie.com/what-is-an-algorithm.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.