MDN Web Docs Glossary: Definitions of Web-related terms \| MDN

::: {#react-container data-component-name="SPA"} ::: {.loading-bar} :::

  • Select language{#skip-language}

  • Skip to search{#skip-search}

  • Technologies

    • Technologies Overview

    • HTML

    • CSS

    • JavaScript

    • Graphics

    • HTTP

    • APIs / DOM

    • Browser Extensions

    • MathML

  • References & Guides

    • Learn web development

    • Tutorials

    • References

    • Developer Guides

    • Accessibility

    • Game development

    • ...more docs

  • Feedback

    • Send Feedback

    • Get Firefox help 🌐

    • Get web development help 🌐

    • Join the MDN community

    • Report a content problem 🌐

    • Report an issue 🌐

::: {.header-search} Search MDN

Open search :::

::: {role="main"} ::: {.titlebar-container} ::: {.titlebar} ::: :::

::: {.full-width-row-container} ::: {.max-content-width-container}

  1. [See ]{.pre-text}[MDN Web Docs Glossary: Definitions of Web-related terms]{property="name"}{.breadcrumb-previous}

  2. [Algorithm]{property="name" aria-current="page"}{.crumb-current-page}

::: {.dropdown-container .language-menu} English[▼]{.dropdown-arrow-down aria-hidden="true"}

  • عربي

  • Deutsch

  • Español

  • Français

  • Bahasa Indonesia

  • 日本語

  • 한국어

  • Polski

  • Português (do Brasil)

  • Русский

  • Українська

  • Tiếng Việt

  • 中文 (简体)

  • 正體中文 (繁體)

  • Add a translation{#translations-add} ::: ::: :::

::: {.wiki-left-present .content-layout} ::: {.section .document-toc} On this Page

Jump to section

::: {#content .article .text-content} An algorithm is a self-contained series of instructions to perform a function.

In other words, an algorithm is a means of describing a way to solve a problem so that it can be solved repeatedly, by humans or machines. Computer scientists compare the efficiency of algorithms through the concept of "Algorithmic Complexity" or "Big O" notation.

For example:

  • A cooking recipe is a simple algorithm for humans.

  • A sorting algorithm is often used in computer programming to explain a machine how to sort data.

Common algorithms are Pathfinding algorithms such as the Traveling Salesman Problem, Tree Traversal algorithms and so on.

There are also Machine Learning algorithms such as Linear Regression, Logistic Regression, Decision Tree, Random Forest, Support Vector Machine, Recurrent Neural Network (RNN), Long Short Term Memory (LSTM) Neural Network, Convolutional Neural Network (CNN), Deep Convolutional Neural Network and so on.

Learn more

General knowledge

  • Algorithm{.external} on Wikipedia

Technical reference

  • Explanations of sorting algorithms{.external}

  • Explanations of algorithmic complexity{.external}

::: {.metadata} ::: {.section .document-meta}

Metadata

  • Last modified: Nov 23, 2019, by MDN contributors ::: ::: ::: ::: :::

::: {.section .newsletter-container} :::

Get the latest and greatest from MDN delivered straight to your inbox.

The newsletter is offered in English only at the moment. :::

::: {.form-group .newsletter-group-email} E-mail :::

::: {#newsletter-privacy .form-group .form-group-agree .newsletter-group-privacy aria-hidden="false"} I'm okay with Mozilla handling my info as explained in this Privacy Policy. :::

::: {.newsletter-group-submit} Sign up now :::

Hide Newsletter Sign-up ::: :::

::: {.content-container} MDN Web Docs{.nav-footer-logo}

  • Web Technologies

  • Learn Web Development

  • About MDN

  • Feedback

  • About

  • MDN Web Docs Store

  • Contact Us

  • Firefox

::: {.social .social-mdn}

MDN

:::

::: {.social .social-moz}

Mozilla

:::

© 2005-2020 Mozilla and individual contributors. Content is available under these licenses.

  • Terms

  • Privacy

  • Cookies ::: :::

:::

Sign in to enjoy the benefits of an MDN account. If you haven't already created an account, you will be prompted to do so after signing in.

::: {.auth-button-container} Sign in with Github{.github-auth} Sign in with Google{.google-auth} :::

Close modal ::: :::

Last updated