Algorithms
This part of the program introduces the principles of design, analysis and optimization of algorithms, addressing control structures, decomposition into sub-problems, complexity, as well as classic programming and problem-solving methods.
Linear and Quadratic Complexity
When seeking to solve a problem with an algorithm, it's essential to measure its efficiency. Complexity allows estimating the necessary resources (time, memory) based on the size of data to process.
Protecting Constant Variables
When retrieving data, for example from a CSV file, it's essential to protect variables that must remain unchanged. We'll see some simple best practices to avoid involuntary errors.
Loop Invariant
When programming a loop, it's often useful to be able to reason about what doesn't change during its execution. This is called a loop invariant.
The Game of Life
A cellular automaton consists of a regular grid of "cells", each containing a "state" chosen from a finite set and which can evolve over time. The state of a cell at time t+1 is a function of the state at time t of a finite number of cells called its "neighborhood". At each new unit of time, the same rules are applied simultaneously to all cells in the grid, producing a new "generation" of cells that depends entirely on the previous generation.
Selection Sort
Selection sort is a simple sorting algorithm that works by selecting the smallest (or largest) element from a list and placing it in the correct position. It's often used to illustrate basic sorting algorithm concepts.