Browse Definitions :
Definition

sorting algorithm

Contributor(s): Ivy Wigmore

A sorting algorithm is a method for reorganizing a large number of items into a specific order, such as alphabetical, highest-to-lowest value or shortest-to-longest distance. Sorting algorithms take lists of items as input data, perform specific operations on those lists and deliver ordered arrays as output. The many applications of sorting algorithms include organizing items by price on a retail website and determining the order of sites on a search engine results page (SERP).

A few examples of sorting algorithms:

  • The bubble sort algorithm repeatedly proceeds through the list, comparing pairs of adjacent items and exchanging their positions if they are in the wrong order. The algorithm passes through the list in that way until the entire list has been sorted.
  • The insertion sort algorithm starts by putting the first two items in order and then compares the third item with the second one, swapping positions if necessary and repeats that action with the first item. Subsequent items subjected to the same process often don't have to be moved far through the sorted items.
  • The Shell sort algorithm compares and sorts items at intervals, decreasing the size of the interval at each pass through the list. The final passes through are a bubble sort but it's much faster because items are already closer to their desired positions.
  • The quicksort algorithm selects a random item in the list, compares all the other items to it and organizes them into those that belong before the selected item and those that belong after it. That means that none of the items have to be compared with those in the other group again. The method proceeds by selecting random items within those two groups of items and repeating the process. Eventually, some other method such as the insertion algorithm does the final sorting.

This TED-ED presentation compares sorting algorithms:

This was last updated in October 2017

Continue Reading About sorting algorithm

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

SearchCompliance

  • risk assessment

    Risk assessment is the identification of hazards that could negatively impact an organization's ability to conduct business.

  • PCI DSS (Payment Card Industry Data Security Standard)

    The Payment Card Industry Data Security Standard (PCI DSS) is a widely accepted set of policies and procedures intended to ...

  • risk management

    Risk management is the process of identifying, assessing and controlling threats to an organization's capital and earnings.

SearchSecurity

SearchHealthIT

SearchDisasterRecovery

  • call tree

    A call tree is a layered hierarchical communication model that is used to notify specific individuals of an event and coordinate ...

  • Disaster Recovery as a Service (DRaaS)

    Disaster recovery as a service (DRaaS) is the replication and hosting of physical or virtual servers by a third party to provide ...

  • cloud disaster recovery (cloud DR)

    Cloud disaster recovery (cloud DR) is a combination of strategies and services intended to back up data, applications and other ...

SearchStorage

  • RAM (Random Access Memory)

    RAM (Random Access Memory) is the hardware in a computing device where the operating system (OS), application programs and data ...

  • business impact analysis (BIA)

    Business impact analysis (BIA) is a systematic process to determine and evaluate the potential effects of an interruption to ...

  • M.2 SSD

    An M.2 SSD is a solid-state drive that is used in internally mounted storage expansion cards of a small form factor.

Close