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 a list refers to the process of arranging the elements in a list in a specific order, such as ascending or descending. It involves comparing and rearranging the elements based on their values.
Related terms
Selection Sort: A sorting algorithm that repeatedly selects the smallest element from an unsorted portion of the list and moves it to its correct position.
Bubble Sort: A simple sorting algorithm that repeatedly compares adjacent elements and swaps them if they are in the wrong order.
Merge Sort: A divide-and-conquer algorithm that divides the list into smaller sublists, sorts them separately, and then merges them back together in order.