
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
In this short lecture, we will be working through 2 examples on how to compute time&space complexity.
Explore binary exponentiation by expressing the exponent in binary, multiplying the base when a bit is one, squaring the base, and shifting through digits to run in log n time.
Apply the inclusion-exclusion principle to compute the union size of multiple sets by adding sizes, subtracting pairwise intersections, and adding back triple intersections.
Discover how the Euclidean algorithm quickly finds the greatest common divisor of two integers by iterating with remainders until one number becomes zero, with concise code and time efficiency.
Explore the extended euclidean algorithm to solve a x + b y = c, requiring c is a multiple of gcd(a,b), and use backward substitution to obtain x and y.
Explore the proof of time complexity for a method that marks composites using the smallest prime factor, showing each number is visited once and prime factors determine the products.
Demonstrates gaussian elimination code: select pivot by max absolute value, handle zeros with epsilon, swap and reduce rows, then back-substitute to classify no, unique, or infinite solutions.
Demonstrate a code implementation of the extended Euclidean algorithm to compute the multiplicative inverse modulo B, returning X as the inverse and swapping X and Y for the general case.
This is a series of courses on popular algorithms used especially in the field of competitive programming!
Competitive programming is a mental sport that tests students on a variety of logical or mathematical problems, and the use of algorithms is essential in improving the efficiency of your solution.
The aim of competitive programming is to write source code of computer programs that are able to solve given problems. Typical such tasks belong to one of the following categories: combinatorics, number theory, graph theory, algorithmic game theory, computational geometry, string analysis, and data structures.
This course focuses not only on the implementation of algorithms but also on the mathematics behind these algorithms since they are requisite in understanding the correctness and efficiency of the algorithms. Specifically, rigid proofs for algorithms will be covered in this series of lectures.
Here, we will be starting with maths puzzles, where the link to mathematics is the most apparent! Hope you will be learning something useful in this course!
If you find this course intriguing or you want to learn more about competitive programming algorithms, please look forward to future addition to the series!
A typical course structure is as follows:
- Problem description
- A naive approach
- Introducing the algorithm
- Mathematical proof of the correctness and efficiency of the algorithm
- A sample problem
- Short quiz
- Hands-on practice