Sorting Algorithm

noun

say it: “SOR-ting AL-guh-rith-um” /ˈsɔːrtɪŋ ˈælɡəˌrɪðəm/

A step-by-step method for putting items in order, such as smallest to largest or A to Z.

What is a sorting algorithm?

A sorting algorithm is a step-by-step method for putting items in order, like a leaderboard from most points to fewest or a playlist from A to Z. Selection sort and insertion sort are simple and O(n²); merge sort and quicksort are fast and O(n log n). In everyday code you call your language's built-in sort.

In a sentence

  • “Merge sort and quicksort are the two sorting algorithms that most built-in sorts are made from.”

Level: Novice · More Data Structures terms at this level

Updated