New course! Every coder should learn Generative AI!
Try a free lesson+ 4
Here's the algorithm.
Take an array and go through and compare each item.
Depending on how you want to sort, have the lower value item moved to the left or right after comparisson.