Description
An algorithm to sort a list
Working
- We check element by element. If one is greater than the other, we switch them.
Time Complexity
- As the list sorts \(n\) times, and repeats this \(n\) times, the time complexity is \( O(n^2) \)
- As a result this algorithm is too innefficient. Have a look at \( O(n \log_2 n) \) algorithms, such as Merge Sort or Quick Sort