QuickSort

Quicksort uses a divide and conquer approach to sorting an array, and leverages recursion. Essentially, you pick a pivot number from the array to be sorted, it can be any number: [4, 6, 2, 1, 5] Let’s pick 2. Now partition the array into two sub-arrays, the numbers less than or equal to the pivot […]

Selection Sort in Python

The selection sort is a nice algorithm, it’s not the fastest but definitely a step up from the bubble sort. It is simple and easy to remember. With the selection sort: identify the smallest item in the source list extract it to the new ordered list repeat for each item in the source list Here […]