Introduction

In this chapter, we'll see some very basic sorting algorithms.

We'll cover the following

Sorting

Even though you most likely won’t end up writing these sorting algorithms in competitions, it’s a good idea to know that these algorithms exist and how they work.

We will discuss the following sorting algorithms that run in O(N2)O(N^2) before moving onto algorithms with better performance.

  • Selection Sort
  • Bubble Sort
  • Insertion Sort

Tip: Try putting print statements inside the loops to see how each step of the algorithm affects the array.


We’ll start with selection sort in the next lesson.

Get hands-on with 1400+ tech skills courses.