Module 2 - Algorithms and Data Structures
November-December 2025
Material for the practical class of Scientific Programming (Module 2). Master of Data Science - University of Trento
Lecturer: Davide Bressan
Email: davide.bressan-1@unitn.it
Contents:
- Home
- Practical 1
- Practical 2
- Practical 3
- Practical 4
- Practical 5
- Practical 6
- Practical 7
- Practical 8
- Practical 9
- Practical 10
- Extra exercises
- Class Definitions (BinaryTree and DiGraphLL)
- Exercise 1 — Count the Number of Nodes in a Tree
- Exercise 2 — Check Whether a Value Exists in the Tree
- Exercise 3 — Compute the Height of the Tree
- Exercise 4.1 — Check if a node has a self edge in a Graph
- Exercise 4.2 — Check if a node is isolated (no edges with other nodes)
- Exercise 5
- Excerise 6
- Extra exercises sol
- Class Definitions (BinaryTree and DiGraphLL)
- Exercise 1 — Count the Number of Nodes in a Tree
- Exercise 2 — Check Whether a Value Exists in the Tree
- Exercise 3 — Compute the Height of the Tree
- Exercise 4.1 — Check if a node has a self edge in a Graph
- Exercise 4.2 — Check if a node is isolated (no edges with other nodes)
- Exercise 5
- Excerise 6
- Midterm exam simulation
- Midterm exam simulation sol