- simplest sorting algo
- keep swaping adjacent element
- application is to understand sorting
- TC: O(n^2)
- Keep two nested loops
- start with first element and keep swapping wherever the elements are smaller and greater
- in bubble sort the largest element will be at end at the end of first pass and in insertion sort
- bubble sort after k iteration you get top k elemets
- after one iteration you have largest element
- code attempt?