Skip to content

Downloads

The lecture notes and the exercise books in PDF, updated at every publication of the site, with the same numbering of definitions, theorems, examples and exercises as the website. Text and figures are released under CC BY 4.0.

Lecture notes

  • Lecture notes, volume 1 · Basic algorithms


    The representation of numbers and pseudo-code, the language in which all the algorithms of the course are written; the first algorithms: sorting (insertion, exchange and selection sort), linear and binary search, numerical algorithms (change of base, primality test, sieve of Eratosthenes, greatest common divisor). Every algorithm with its pseudo-code and examples executed step by step.

    lecture-notes-1-basic-algorithms.pdf

  • Lecture notes, volume 2 · Programming languages


    From pseudo-code to programs: three programming languages, C++ (compiled), Python (interpreted) and Java (compiled to bytecode and run by a virtual machine). For each: variables and data types, input and output, operators, conditional statements, loops, arrays and lists, functions, bitwise operators and a complete algorithm, with the comparison of the three languages.

    lecture-notes-2-programming-languages.pdf

  • Lecture notes, volume 3 · Asymptotic notation and growth


    How the functions of a natural variable that count the steps of an algorithm are compared: the asymptotic notations Theta, big O, Omega, little o and omega, their properties and the limit criterion; then the families of increasing functions (logarithms, powers, exponentials, factorial), the hierarchy of infinities and the comparison of orders of growth written with the symbols. Limits and functions of a natural variable are taken from the course of Mathematical Analysis 1.

    lecture-notes-3-asymptotic-notation.pdf

  • Lecture notes, volume 4 · Analysis of algorithms


    The analysis of algorithms: the input size, the running time in the best, worst and average case, and correctness proved with loop invariants.

    lecture-notes-4-analysis.pdf

  • Lecture notes, volume 5 · Recursion


    Recursion: classical recursive algorithms, recurrence relations, the Master Theorem, recursive algorithms (array sum, merge sort, binary search, maximum subarray) and the comparison between recursive and iterative versions.

    lecture-notes-5-recursion.pdf

Exercises

  • Exercises, volume 1 · Basic algorithms


    Worked exercises on chapters 1--5: representation of numbers, pseudo-code, sorting, searching and numerical algorithms. Every exercise has a complete solution.

    exercises-1-basic-algorithms.pdf

  • Exercises, volume 2 · Programming languages


    Worked exercises on chapters 6--8: programs in C++, Python and Java, from pseudo-code to code. Every exercise has a complete solution.

    exercises-2-programming-languages.pdf

  • Exercises, volume 3 · Asymptotic notation and growth


    Worked exercises on chapters 9--10: the asymptotic notations Theta, big O, Omega, little o and omega, and the comparison of orders of growth. Every exercise has a complete solution.

    exercises-3-asymptotic-notation.pdf

  • Exercises, volume 4 · Analysis of algorithms


    Worked exercises on chapters 11--13: input size, running time, correctness. Every exercise has a complete solution.

    exercises-4-analysis.pdf

  • Exercises, volume 5 · Recursion


    Worked exercises on chapters 14--18: recursion, recurrence relations, the Master Theorem, recursive algorithms, recursive versus iterative. Every exercise has a complete solution.

    exercises-5-recursion.pdf