What is an algorithm? | TechTarget (2026)

What is an algorithm? | TechTarget (1)

By

  • Alexander S. Gillis,Technical Writer and Editor

What is an algorithm?

An algorithm is a procedure used for solving a problem or performing a computation. Algorithms act as an exact list of instructions that conduct specified actions step by step in either hardware- or software-based routines.

Algorithms are widely used throughout all areas of IT. In mathematics, computer programming and computer science, an algorithm usually refers to a small procedure that solves a recurrent problem. Algorithms are also used as specifications for performing data processing and play a major role in automated systems.

An algorithm could be used for sorting sets of numbers or for more complicated tasks, such as recommending user content on social media. Algorithms typically start with initial input and instructions that describe a specific computation. When the computation is executed, the process produces an output.

How do algorithms work?

Algorithms work by following a set of instructions or rules to complete a task or solve a problem. They can be expressed as natural languages, programming languages, pseudocode, flowcharts and control tables. Natural language expressions are rare, as they are more ambiguous. Programming languages are normally used for expressing algorithms executed by a computer.

This article is part of

What is machine learning and how does it work? In-depth guide

  • Which also includes:
  • 4 types of learning in machine learning explained
  • How to build a machine learning model in 7 steps
  • CNN vs. RNN: How are they different?

Algorithms use an initial input along with a set of instructions. The input is the initial data needed to make decisions and can be represented in the form of numbers or words. The input data gets put through a set of instructions, or computations, which can include arithmetic and decision-making processes. The output is the last step in an algorithm and is normally expressed as more data.

For example, a search algorithm takes a search query as input and runs it through a set of instructions for searching through a database for relevant items to the query. Automation software acts as another example of algorithms, as automation follows a set of rules to complete tasks. Many algorithms make up automation software, and they all work to automate a given process.

What are different types of algorithms?

There are several types of algorithms, all designed to accomplish different tasks:

  • Search engine algorithm. This algorithm takes search strings of keywords and operators as input, searches its associated database for relevant webpages and returns results.
  • Encryption algorithm. This computing algorithm transforms data according to specified actions to protect it. A symmetric key algorithm, such as the Data Encryption Standard, for example, uses the same key to encrypt and decrypt data. If the algorithm is sufficiently sophisticated, no one lacking the key can decrypt the data.
  • Greedy algorithm. This algorithm solves optimization problems by finding the locally optimal solution, hoping it is the optimal solution at the global level. However, it does not guarantee the most optimal solution.
  • Recursive algorithm. This algorithm calls itself repeatedly until it solves a problem. Recursive algorithms call themselves with a smaller value every time a recursive function is invoked.
  • Backtracking algorithm. This algorithm finds a solution to a given problem in incremental approaches and solves it one piece at a time.
  • Divide-and-conquer algorithm. This common algorithm is divided into two parts. One part divides a problem into smaller subproblems. The second part solves these problems and then combines them to produce a solution.
  • Dynamic programming algorithm. This algorithm solves problems by dividing them into subproblems. The results are then stored to be applied to future corresponding problems.
  • Brute-force algorithm. This algorithm iterates all possible solutions to a problem blindly, searching for one or more solutions to a function.
  • Sorting algorithm. Sorting algorithms are used to rearrange data structures based on a comparison operator, which is used to decide a new order for data.
  • Hashing algorithm. This algorithm takes data and converts it into a uniform message with a hashing.
  • Randomized algorithm. This algorithm reduces running times and time-based complexities. It uses random elements as part of its logic.
What is an algorithm? | TechTarget (2)

What are examples of algorithms?

Machine learning is a good example of an algorithm, as it uses multiple algorithms to predict outcomes without being explicitly programmed to do so.

Machine learning uses supervised learning or unsupervised learning. In supervised learning, data scientists supply complex algorithms with labeled training data and define the variables they want the algorithm to assess for correlations. Both the input and the output of the algorithm are specified.Unsupervised machine learning involves algorithms that train on unlabeled data and sift through it to look for patterns that can be used to group data points into subsets. Most types of deep learning, including neural networks, are unsupervised algorithms.

Machine learning used in artificial intelligence also relies on algorithms. However, machine learning-based systems may have inherent biases in the data that feeds the machine learning algorithm. This could result in systems that are untrustworthy and potentially harmful.

Although algorithms are used extensively in computer science, AI and machine learning scenarios, they're also employed frequently in everyday life.

The following are some examples of algorithms used in real life:

  • Following a recipe. Recipes provide a series of steps to achieve a particular objective, such as preparing blueberry muffins or making spaghetti sauce from scratch. Recipes aim to produce consistent results and help individuals -- regardless of their background -- create a specific dish by following detailed instructions. In this way, recipes mirror computer science algorithms, which outline steps for generating reproducible outcomes.
  • Tying shoelaces. Tying shoelaces is another example of following an algorithm. For example, there are a finite number of steps that lead to a properly tied traditional shoelace knot, which is often referred to as the "bunny rabbit" or "loop, swoop and pull" knot.
  • Facial recognition. Facial recognition is widely used in iPhone logins as well as Snapchat and Instagram filters. It works by projecting facial traits from a photo or video onto a biometrics map using an algorithm. The program then looks for a match between this map and a database of faces to confirm the user's identification. If facial recognition is used for Snapchat or Instagram filters, there is no need for searching the database because the algorithm simply builds a map of the face and applies the filter to it.
  • Traffic signals. Traffic signals use smart algorithms to manage traffic flow. These algorithms group different algorithms or movements, such as going straight or turning right, into phases, which helps ensure safety and efficiency. For example, when a motorist approaches a red light, the traffic signal is cycling through these phases. By evaluating the volume of traffic, an algorithm decides when it's safe for the vehicle to move forward.
  • Sorting documents and papers. This is a great example of how algorithms can be used for various tasks and purposes, such as sorting files alphabetically, by word count, by date, or by any other specifications. When someone arranges their personal or professional documents according to a set of instructions, they are applying algorithmic thinking to simplify the organization process by using small tasks.
  • Searching for a book in the library. Finding a library book is like following an algorithm or a step-by-step plan. For example, there are different ways to do it, such as using the library's computer system or looking for labels on the shelves that show the book's genre, subject or author. No matter which method one chooses, if it can be explained and done by others, then it can be classified as an algorithm.

Discover how AI algorithms work and provide a competitive edge for businesses. Explore the main types and learn the importance of evaluating both the benefits and risks associated with these algorithms.

This was last updated in July 2023

Continue Reading About algorithm

  • Top 10 AI and machine learning trends
  • Why algorithmic auditing can't fully cope with AI bias in hiring
  • 12 key benefits of AI for business
  • What is AI governance and why do you need it?
  • Top 9 types of machine learning algorithms, with cheat sheet

Related Terms

3D (three dimensions or three dimensional)
3D, or three dimensional, refers to the three spatial dimensions of width, height and depth.Seecompletedefinition
data engineer
A data engineer is an IT professional whose primary job is to prepare data for analytical or operational uses.Seecompletedefinition
data sampling
Data sampling is a statistical analysis technique used to select, manipulate and analyze a representative subset of data points ...Seecompletedefinition
What is an algorithm? | TechTarget (2026)

FAQs

What is an algorithm simple answer? ›

An algorithm is a procedure used for solving a problem or performing a computation. Algorithms act as an exact list of instructions that conduct specified actions step by step in either hardware- or software-based routines.

What is an algorithm in very short answer? ›

An algorithm is a set of commands that must be followed for a computer to perform calculations or other problem-solving operations. According to its formal definition, an algorithm is a finite set of instructions carried out in a specific order to perform a particular task.

What is algorithm one line answer? ›

Definition of Algorithm

The word Algorithm means ” A set of finite rules or instructions to be followed in calculations or other problem-solving operations ” Or. ” A procedure for solving a mathematical problem in a finite number of steps that frequently involves recursive operations”.

Can you explain what an algorithm is? ›

An algorithm is a set of instructions for solving a problem or accomplishing a task. One common example of an algorithm is a recipe, which consists of specific instructions for preparing a dish or meal.

What is a algorithm example? ›

Any step-by-step process that is completed the same way every time is an algorithm. A good example of this in everyday life is tying your shoes. There are a limited number of steps that effectively result in a traditional shoelace know (known as the “bunny rabbit” or “loop, swoop and pull” knot).

How to write an algorithm example? ›

Ex. 1. Write the algorithm to find the sum and product of two given numbers. Algorithm: To find the sum and product of two given numbers: Step 1: Read A , B Step 2: Let Sum= A+B Step 3: Let Product=A*B Step 4: Print Sum, Product Step 5: Stop.

What is an algorithm in real life? ›

Just like sorting papers and even tying your shoes, following a recipe is a type of algorithm. The goal of course is to create a duplicated outcome. To complete a recipe you have to follow given set of instructions.

What does an algorithm look like? ›

An algorithm is not computer code; it's written in plain English and may be in the form of a flowchart with shapes and arrows, a numbered list, or pseudocode (a semi-programming language). It doesn't beat around the bush. It's very clear and efficient, and it has a start, middle, and end.

What is the most simple algorithm? ›

1. Brute Force Algorithm: This is the most basic and simplest type of algorithm. A Brute Force Algorithm is the straightforward approach to a problem i.e., the first approach that comes to our mind on seeing the problem.

How do you solve simple algorithms? ›

There are some basics steps to make an algorithm:
  1. Start – Start the algorithm.
  2. Input – Take the input for values in which the algorithm will execute.
  3. Conditions – Perform some conditions on the inputs to get the desired output.
  4. Output – Printing the outputs.
  5. End – End the execution.
Aug 9, 2021

How do algorithms work for kids? ›

To explain the algorithm definition for kids: An algorithm is like a detailed recipe that tells a computer or a person what steps to take to solve a problem or complete a task. Programmers write algorithms so that computers can understand how to perform a task.

What is TikTok's algorithm? ›

The TikTok algorithm is a system that decides which videos appear on a user's For You Page. It's based on a proprietary combination of signals, but TikTok has revealed at least a few of the factors it takes into account when evaluating recommendations: user interactions, video information and device settings.

What are the 4 types of algorithm? ›

There are four types of machine learning algorithms: supervised, semi-supervised, unsupervised and reinforcement.

Is an algorithm a simple formula? ›

An algorithm is a formula as well as a procedure. Therefore conceptually a formula is a subset of an algorithm. Algorithms can be defined either in a procedure or a formula.

What is an algorithm in math for kids? ›

An algorithm is a set of step-by-step instructions that describe how to perform a task. These steps are used to solve a problem or reach a result.

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6127

Rating: 4.9 / 5 (79 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.