Bubble sort is a simple sorting algorithm that repeatedly steps through a list, compares adjacent elements, and swaps them if they are in the wrong order. This process is repeated for each element in the list until no further swaps are needed, indicating that the list is sorted. In each pass, the largest unsorted element “bubbles” to its correct position. The algorithm has a time complexity of O(n²) in the worst and average cases, making it inefficient for large datasets. Despite its simplicity, it is rarely used in practice due to its poor performance compared to other sorting algorithms like quicksort.