A sorting algorithm is an algorithm that arranges items of a list in a certain order like numerical or alphabetical. Common efficient sorting algorithms have average time complexity of O(n log n) by comparing elements, though some have better performance on certain data. Popular general sorting algorithms used in practice are heap sort, merge sort, and quicksort, sometimes with modifications for real-world data.