# Bubble Sort

##### Intuition

Learn how to perform bubble sort yourself (without a computer) to develop a feel for the algorithm.

#### Intuition:

Bubble Sort takes in a list of values and sorts them from lowest to highest. It does this in two steps:

- loop through each position from left to right. Per position:

if the value at the current one is greater than the next, swap the values. - If at least one swap occurred during step one repeat the entire procedure, otherwise the list is sorted.

##### Analysis

Analyze the runtime and memory usage with big-O notation. No previous background is necessary!

#### Analysis:

- Learn the basics of big-O notation
- Determine why bubble sort uses
*O(n*or quadratic time in the worst case^{2}) - Determine why bubble sort uses
*O(1)*or constant extra memory in any case, i.e. it works in-place. - Briefly discuss applications.

##### Song and Code

MEMORIZE bubble sort by learning the musicAlgo and see me use the lyrics to code the algorithm.

#### Song and Code:

- Hear the quick bubble sort song:
- The first part covers big-O analysis facts and a general description of the algorithm.
- The second covers the pseudocode which will help you program bubble sort in any programming language.

- Watch me demonstrate how to use the song lyrics to implement the algorithm in Python, the most straightforward programming language (in my opinion).

#### Intuition:

Bubble Sort takes in a list of values and sorts them from lowest to highest. It does this in two steps:

- loop through each position from left to right. Per position:

if the value at the current one is greater than the next, swap the values. - If at least one swap occurred during step one repeat the entire procedure, otherwise the list is sorted.

#### Analysis:

- Learn the basics of big-O notation
- Determine why bubble sort uses
*O(n*or quadratic time in the worst case^{2}) - Determine why bubble sort uses
*O(1)*or constant extra memory in any case, i.e. it works in-place. - Briefly discuss applications.

#### Song and Code:

- Hear the quick bubble sort song:
- The first part covers big-O analysis facts and a general description of the algorithm.
- The second covers the pseudocode which will help you program bubble sort in any programming language.

- Watch me demonstrate how to use the song lyrics to implement the algorithm in Python, the most straightforward programming language (in my opinion).