There are many types of algorithms that exist. I’m going to look at some sorting algorithms and talk at a high level how they work.

Bubble Sort

Bubble Sort works by comparing the first two values in an array and swapping their positions if the first one is bigger than the second one. When you get to the end of the array you know the largest value will be at the end. By repeating this process the array will become sorted.


Bogosort is an amusing algorithm. It will randomly sort the list then check to see if it is sorted. If it’s not sorted it will repeat the process. This is equivalent to throwing a deck of cards into the air, gathering them up, then seeing if they are sorted.

This is a clickable image:


This is a smart thumbnail: