Skip to main content
Loading page…
Python Mastery
Chapter 24
Lesson 4 of 5
Sorting & Searching
Contents
Notes
Tutor
Concept
Python's Built-in Sorting: sorted() and list.sort()
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
28 min
9 activities
0 of 9 done
In this lesson
1
Python's Built-in Sorting: sorted() and list.sort()
2
Timsort: The Algorithm Behind sorted()
3
Merge Sort & Quicksort: Understanding Divide and Conquer
4
Binary Search & the bisect Module
5
Binary Search Implementation
6
Sort with a Custom Key
7
Timsort Best Case
8
Binary Search Steps
9
Gotcha: sorted() vs list.sort() Return Values
Objectives
Use sorted() and list.sort() with custom key functions
Explain the difference between stable and unstable sorts
Explain how Timsort works at a high level and its performance guarantees
Implement binary search from scratch and use the bisect module
Implement merge sort and quicksort to understand divide-and-conquer
Chapter 24 · Data Structures & Algorithms in Python
Big-O & Python Operation Costs
Stacks, Queues & Linked Lists
Trees, Heaps & Graphs
Sorting & Searching
Recursion, Backtracking & Dynamic Programming
Previous: Trees, Heaps & Graphs
Next: Recursion, Backtracking & Dynamic Programming