Big O notation: Python to Rust
Ends soon! Keep adding new skills with 10,000+ programs for $239 (usually $399). Save now.
Big O notation: Python to Rust
This course is part of Rust for Data Engineering Specialization
Instructor: Noah Gift
Included with
Learn more
Skills you'll gain
Tools you'll learn
Details to know
May 2026
1 assignment
See how employees at top companies are mastering in-demand skills
Build your subject-matter expertise
- Learn new concepts from industry experts
- Gain a foundational understanding of a subject or tool
- Develop job-relevant skills with hands-on projects
- Earn a shareable career certificate
There are 5 modules in this course
Big O notation: Python to Rust is a hands-on algorithmic complexity course for engineers transitioning from Python to Rust who want to reason rigorously about how their code scales. You will learn Big O, Big Theta, and Big Omega notation; analyze the time and space complexity of common operations on Python and Rust data structures (list/Vec, dict/HashMap, set/HashSet, tuple, slice, BTreeMap); and compare measured performance in both languages on identical workloads. The course covers amortized analysis, recursion and master theorem, worst case versus expected case, the cost of allocation and borrowing, and how Rust's ownership model affects real-world constants even when asymptotic complexity is identical. You will profile Python code with cProfile and timeit, profile Rust code with criterion and perf, and translate Python algorithms (search, sort, hashing, graph traversal, dynamic programming) into idiomatic Rust while keeping or improving complexity guarantees. By the end of the course, you will be able to predict performance, choose appropriate data structures, justify rewrites from Python to Rust on quantitative grounds, and communicate trade-offs to a team. Part of the Rust for Data Engineering specialization.
Set the foundation: define what "complexity" actually means as a claim, and meet the three modes of proof β analytical, empirical, and structural β you'll use to defend complexity claims throughout the course. Learn to recognize falsifiable vs. unfalsifiable performance claims and build the worked-example habit you'll need in later modules.
What's included
3 videos7 readings
3 videosβ’Total 4 minutes
- 1.1.1 What Complexity Means And Three Modesβ’1 minute
- 1.2.1 Reading A Complexity Claimβ’1 minute
- 1.3.1 Depyler Transpiler Shortcutβ’1 minute
7 readingsβ’Total 70 minutes
- About This Courseβ’10 minutes
- Key Terms: What "Complexity" Means + Three Modes of Proofβ’10 minutes
- Reflection: What "Complexity" Means + Three Modes of Proofβ’10 minutes
- Key Terms: Reading a Complexity Claim β Falsifiabilityβ’10 minutes
- Reflection: Reading a Complexity Claim β Falsifiabilityβ’10 minutes
- Key Terms: Depyler β the Transpiler Shortcutβ’10 minutes
- Reflection: Depyler β the Transpiler Shortcutβ’10 minutes
Empirical proof in practice: measure runtime with reproducible benchmarks. Three head-to-head PythonβRust translations β list comprehension to iterator, dict lookup to HashMap, and sorted() to sort_unstable β let you read benchmark output, control for noise, and decide when measured speedups are real and when they're artifacts.
What's included
3 videos6 readings
3 videosβ’Total 4 minutes
- 2.1.1 List Comp To Iteratorβ’1 minute
- 2.2.1 Dict Lookup To Hashmapβ’1 minute
- 2.3.1 Sorted To Sort Unstableβ’1 minute
6 readingsβ’Total 60 minutes
- Key Terms: List Comprehension β Iteratorβ’10 minutes
- Reflection: List Comprehension β Iteratorβ’10 minutes
- Key Terms: x in dict β HashMap Lookupβ’10 minutes
- Reflection: x in dict β HashMap Lookupβ’10 minutes
- Key Terms: sorted() β sort_unstableβ’10 minutes
- Reflection: sorted() β sort_unstableβ’10 minutes
Structural proof in practice: use the type system to make incorrect programs impossible to compile. Translating Optional[T] to Option<T>, try/except to Result<T,E>, and ad-hoc state machines to Rust enums turns runtime errors into compile-time errors β a structural guarantee no benchmark can refute.
What's included
3 videos6 readings
3 videosβ’Total 3 minutes
- 3.1.1 Optional To Optionβ’1 minute
- 3.2.1 Try Except To Resultβ’1 minute
- 3.3.1 Mutable Default To Ownershipβ’1 minute
6 readingsβ’Total 60 minutes
- Key Terms: Optional[T] β Option<T>β’10 minutes
- Reflection: Optional[T] β Option<T>β’10 minutes
- Key Terms: try/except β Result<T, E>β’10 minutes
- Reflection: try/except β Result<T, E>β’10 minutes
- Key Terms: Mutable Default Arg β Ownershipβ’10 minutes
- Reflection: Mutable Default Arg β Ownershipβ’10 minutes
Translation with runtime consequences: each translation in this module replaces a Python construct (generators, subprocess calls, parallel loops) with a Rust equivalent that carries different runtime guarantees β memory profile, error surface, parallelism model β not just "the same thing, but faster."
What's included
3 videos6 readings
3 videosβ’Total 3 minutes
- 4.1.1 Generator To Iteratorβ’1 minute
- 4.2.1 Subprocess To Commandβ’1 minute
- 4.3.1 Threading To Rayonβ’1 minute
6 readingsβ’Total 60 minutes
- Key Terms: Generator β Iteratorβ’10 minutes
- Reflection: Generator β Iteratorβ’10 minutes
- Key Terms: Subprocess β Commandβ’10 minutes
- Reflection: Subprocess β Commandβ’10 minutes
- Key Terms: Threading β Rayonβ’10 minutes
- Reflection: Threading β Rayonβ’10 minutes
Capstone: bring all three modes of proof together on a real translation. Two case studies β a three-mode playbook end to end, and a deliberate "when NOT to translate" example β train your judgment about when a PythonβRust port pays off and when it would just add cost without measurable benefit.
What's included
2 videos5 readings1 assignment
2 videosβ’Total 2 minutes
- 5.1.1 Three-Mode Playbook End To Endβ’1 minute
- 5.2.1 When NOT to Translateβ’1 minute
5 readingsβ’Total 50 minutes
- Key Terms: Three-Mode Playbook End to Endβ’10 minutes
- Reflection: Three-Mode Playbook End to Endβ’10 minutes
- Key Terms: When NOT to Translateβ’10 minutes
- Reflection: When NOT to Translateβ’10 minutes
- Before You Go: Share Your Feedbackβ’10 minutes
1 assignmentβ’Total 30 minutes
- Final Quiz: The Three-Mode Proof Playbookβ’30 minutes
Earn a career certificate
Add this credential to your LinkedIn profile, resume, or CV. Share it on social media and in your performance review.
Instructor
Offered by
Explore more from Software Development
- P
Pragmatic AI Labs
Course
- P
Pragmatic AI Labs
Course
- P
Pragmatic AI Labs
Course
- P
Pragmatic AI Labs
Course
Why people choose Coursera for their career
Frequently asked questions
To access the course materials, assignments and to earn a Certificate, you will need to purchase the Certificate experience when you enroll in a course. You can try a Free Trial instead, or apply for Financial Aid. The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.
When you enroll in the course, you get access to all of the courses in the Specialization, and you earn a certificate when you complete the work. Your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.
Yes. In select learning programs, you can apply for financial aid or a scholarship if you canβt afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, youβll find a link to apply on the description page.
More questions
Financial aid available,
