Sorting Algorithms in Python

Sorting Algorithms in Python

by Santiago Valdarrama Updated Reading time estimate 48m intermediate algorithms python

Sorting is a basic building block that many other algorithms are built upon. It’s related to several exciting ideas that you’ll see throughout your programming career. Understanding how sorting algorithms in Python work behind the scenes is a fundamental step toward implementing correct and efficient algorithms that solve real-world problems.

In this tutorial, you’ll learn:

  • How different sorting algorithms in Python work and how they compare under different circumstances
  • How Python’s built-in sort functionality works behind the scenes
  • How different computer science concepts like recursion and divide and conquer apply to sorting
  • How to measure the efficiency of an algorithm using Big O notation and Python’s timeit module

By the end of this tutorial, you’ll understand sorting algorithms from both a theoretical and a practical standpoint. More importantly, you’ll have a deeper understanding of different algorithm design techniques that you can apply to other areas of your work. Let’s get started!