
Explore recursion as a tool in mathematics and computer science, defining infinite objects from finite sentences, with examples like factorial, greatest common divisor, Fibonacci, tree-like fractals, and C++ recursive functions.
Explore the greatest common divisor and Euclid's algorithm, including division-based methods and practical applications to lattice points, squares, cubes, and the jug problem.
The classical Josephus' problem is analyzed. Some less known properties are highlighted.
Explore greedy algorithms through classic problems like the activity selection problem and Kadane's algorithm for maximum subarray sums, including interval scheduling and pairing examples.
Explore backtracking, a recursive technique that generates arrays and solves constraints such as permutations, n queens, and sudoku, using recursion, stacks, and set-based checks.
Explore the knight's path on an n-by-n chessboard, visiting every square exactly once using a backtracking C++ approach with a move matrix and recursive search.
Learn the divide and conquer technique for problem solving and software engineering by breaking problems into smaller subproblems and combining their solutions, with Hanoi towers, triominoes, and tetrominoes examples.
Encode a subdivided square with digits 1-4, update a binary x/y code with moves, and derive the final code implemented in C++ with ties to image representations and keyword trees.
Explore sorting algorithms, including merge sort, quick sort, and radix sort, using divide and conquer. Examine stability, space requirements, and operation counts like n log n vs n^2.
Explore dynamic programming through two classic examples—the longest increasing subsequence and Stirling numbers of the second kind—and learn to use auxiliary arrays, recurrence, and subproblem decomposition for applications.
Explore memoisation as a top-down dynamic programming approach using recursion and caching. See how it computes Stirling numbers of the second kind and solves triangle path problems.
Apply dynamic programming to count non-attacking rooks on an imaginary board using the R[i][j] recurrence, then count non-attacking bishops on a chessboard.
Learn how to count word occurrences in a letter grid using dynamic programming, including prefix-based layering, and compare with Boggle’s backtracking approach that prohibits revisiting squares.
Explore Catalan numbers, definitions and recurrences for counting correctly paired parentheses, and apply them to equivalent problems and a C++ program computing C[n] modulo 1000000007.
Explore dynamic programming techniques to compute probabilities for independent events, sample space definitions, and practical applications such as night moves on a chessboard, tennis match outcomes, and rainy weather.
Learn dynamic programming techniques through games with numbers, greed on parks, and matrix path problems, with DP formulations, examples, and a C++ implementation.
Explore the bridge and torch problem with dynamic programming and greedy strategies, modeling crossings with bitmasks to reach the other shore.
Contrast linear search with binary search on sorted arrays, showing log(n) efficiency and first or last occurrence detection. Highlight applications from computational geometry to autocompletion, plus exercises and complexity notes.
Explore the longest increasing subsequence problem, its n log n binary-search algorithm, a dynamic programming approach, and related problems like optimal decomposition into increasing subsequences and packing boxes.
Learn how ternary search exploits unimodal functions to shrink intervals and locate minima, with applications to minimum dispersion of moving vehicles and the smallest circle problem, plus Welzl's recursive algorithm.
Determine a square ABCD that contains all given points by rotating the set to balance the bounding box, using a rotation matrix and angle-based binary search.
Learn matrix exponentiation and its properties, including the product of two matrices and efficient A^p, using the Q matrix for Fibonacci numbers and adjacency matrices for directed graphs.
Apply the sliding window technique to compute minimum and maximum values in 1D and 2D arrays, solve trapped water problems, and find subarray minima in linear time.
Master advanced dynamic programming techniques for problems with overlapping subproblems, including dynamic programming on states, high-dimensional arrays, dynamic programming on trees and games, with memoization and hashing.
Explore dynamic programming for computational geometry problems, including optimal triangulation of convex polygons and selecting a convex polygon with the maximum number of vertices from a set of points.
Explore the traveling salesman problem using dynamic programming with a matrix DP approach in C++, focusing on visiting every city exactly once and returning to the starting point.
This course presents a group of elementary and advanced Algorithms and Programming Techniques. It is the result of my own experience as a trainer in the field of Competitive Programming, teacher, author and (many times) competitor. It is based on the most important theoretical issues and knowledge a student should master. The topics that are discussed stretch from Recursion and its different peculiar applications (Backtracking, Divide and Conquer) to the Branch and Bound method. The course has two different lessons dedicated to the Dynamic Programming Technique, due to the importance this method has.
The course contains many well known problems, presents their solutions in a comprehensible way and offers C++ solutions. A clear purpose and objective that the author had in mind was to have neat statements, proper examples, efficient solutions, easy to understand C++ programs. I suppose that the students already have some elementary background in the C++ language, some experience with STL data structures and implemented methods, CodeBlocks Integrated Development Environment, Online Judges .
Each lesson is followed by some quizzes.
The students are advised to try to implement on their own the C++ programs for the problems they encounter in the lessons.
Every time when it was possible, I used some pictures, animations, free templates offered by different sites.
I hope you will enjoy and appreciate this course.