Bubble Sort is an easy sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
The time complexity of Bubble Sort is O(n²) in the worst and average cases, where n is the number of elements in the array.
In the best-case scenario, when the array is already sorted, the algorithm can terminate early due to the isSwapped optimization, resulting in a time complexity of O(n).
Bubble Sort is an excellent algorithm for educational purposes due to its simplicity, but it is not suitable for large datasets due to its quadratic time complexity.