Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 exam•Written by the Fiveable Content Team • Last updated September 2025
Definition
Sorting refers to arranging elements in ascending or descending order based on certain criteria, such as numerical value or alphabetical order.
Related terms
Selection Sort: Selection sort is a simple sorting algorithm that repeatedly selects the smallest or largest element from an unsorted portion of the list and places it in its correct position.
Merge Sort: Merge sort is a divide-and-conquer algorithm that divides the input into smaller parts, sorts them individually, and then merges them back together to obtain a sorted result.
Bubble Sort: Bubble sort is a comparison-based sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order until the entire list is sorted.