Sort Algorithm - Bubble Sort
Last updated on September 4, 2023 pm
Definition:
Bubble sort is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares adjacent elements, and swaps them if they are in the wrong order. It continues these steps until the entire list is sorted. While straightforward, it’s not very efficient for large lists due to its O(n^2) time complexity.
Code:
1 |
|
Sort Algorithm - Bubble Sort
http://hihiko.zxy/2023/09/04/Sort-Algorithm-Bubble-Sort/