Algorithms and Data Structures
|
Contents | Program | Teaching material |
Lessons timetable | Exams and sample tests | |
Lessons topics and resources |
The course covers algorithmic programming techniques. The primary goal is to study algorithms and data structures that efficiently solve problems that would require very high computational resources (time or space) using trivial approaches.
We will address problems frequently arising in practical applications and real-world situations, such as sorting, searching, and graph traversal, as well as general design techniques including divide and conquer, greedy algorithms, and dynamic programming.
The course will cover the entire algorithm engineering cycle, addressing the design, theoretical analysis, implementation, and experimental evaluation of algorithms and data structures. The students will practice solving computational problems, designing new algorithms, and implementing efficient solutions in Python.
Introduction to the Design and Analysis of Algorithms
Anany Levitin, Pearson
resources are available on the web, an alternative textbook is
Algorithms Design, by
Goodrich and Tamassia
A more comprehensive text is:
Introduction to Algorithms
T. Cormen, C. Leiserson, R. Rivest, and C. Stein, McGraw-Hill.
An introductory textbook on Python is:
Allen Downey,
Thinking in Python - How to Think Like a Computer Scientist,
second edition
pdf available on github
under the GNU Free Documentation License
The exam consists in a written test, a programming exercise, and possibly a colloquium.
Samples of exam tests are available in this zipped folder
22 February 2021 | 24 February 2021 |
1 March 2021 | 3 March 2021 |
8 March 2021 lesson is cancelled | 10 March 2021 |
15 March 2021 | 17 March 2021 |
22 March 2021 | 24 March 2021 |
29 March 2021 | 31 March 2021 lesson is cancelled |
Easter holydays | 7 April 2021 |
12 April 2021 | 14 April 2021 |
19 April 2021 | 21 April 2021 |
26 April 2021 | 28 April 2021 |
3 May 2021 | 5 May 2021 |
10 May 2021 | 12 May 2021 |
17 May 2021 | 19 May 2021 |
24 May 2021 |
For any need, contact me at
paoloA_DOT_HEREfranciosaAN_"at"_HEREuniroma1A_DOT_HEREit
22 September 2021 | |
---|---|
Topics |
|
Resources | Lesson recording is available on
this Zoom link Passcode: H42F6ug& this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
24 September 2021 | |
---|---|
Topics |
|
Resources | Lesson recording is available on
this Zoom link Passcode: !7A$Mw1a this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
1 March 2021 | |
---|---|
Topics |
|
Resources | Lesson recording is available on
this Zoom link Passcode: =*!PcZ7q this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
3 March 2021 | |
---|---|
Topics |
A brief introduction to Python language (see here for a basic textbook on Python)
|
Resources | A portable version of Thonny for Windows, including a Python interpreter, can be downloaded
here. Just unzip the thonny-3.zip compressed folder and execute file thonny.exe Lesson recording is available on this Zoom link Passcode: ?i.0TaRu this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
10 March 2021 | |
---|---|
Topics |
A brief introduction (II) to Python language (see here for a basic textbook on Python)
|
Resources | A portable version of Thonny for Windows, including a Python interpreter, can be downloaded
here. Just unzip the thonny-3.zip compressed folder and execute file thonny.exe Lesson recording is available on this Zoom link Passcode: D^^q0+mF this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
15 March 2021 | |
---|---|
Topics |
Divide and Conquer. Recursive implementation of D&C algorithms. Identify base cases, build subinstances, recursive calls, combine subsolutions. Complexity of & algorithms: recurrence equations. Master Theorem Integer multiplication, matrix multiplication (Strassen algorithm) Sorting via D&C: Merge Sort. |
Resources | Lesson recording is available on
this Zoom link Passcode: &RE8NVU@ this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
17 March 2021 | |
---|---|
Topics |
A brief introduction (III) to Python language (see here for a basic textbook on Python)
Examples of recursive algorithms in Python |
Resources | Lesson recording is available on
this Zoom link Passcode: !Gq?Djy4 this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
22 March 2021 | |
---|---|
Topics |
Quick sort, analysis of quick sort: best case, worst case (find the code of Quick sort here). Randomized Quick Sort: analysis of average case. Quick sort vs. Merge sort: stability, in-place k-th element selection algorithm, complexity analysis(find the code of k-selection here). |
Resources | Lesson recording is available on
this Zoom link Passcode: J66A30.l this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
24 March 2021 | |
---|---|
Topics |
Linear time k-th element selection algorithm, (Blum et al., 1973) The concept of Abstract Data Type. Information hiding. Introduction to OO programming in Python. Implementation of a simple class Pointer based structures: linked lists vs. Python lists (arrays) |
Resources | Lesson recording is available on
this Zoom link Passcode: &27%syUW this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
29 March 2021 | |
---|---|
Topics |
Primitives on pointer based lists: insertion, deletion, search Python implementation of linked lists linkedListClass.py. Use of linked lists in useLinkedList.py Last In First Out (LIFO) and First In First Out (FIFO) policies: Stacks and Queues Implementation of a stack by a linked list StackModule.py. |
Resources | Lesson recording is available on
this Zoom link Passcode: yd@8kUsr this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
7 April 2021 | |
---|---|
Topics |
Implementation of a queue (FIFO) by a linked list QueueModule.py, uses class headTailLinkedListClass.py. Implementation of arrays, map functions for uni-dimensional and bi-dimensional arrays. Dictionaries: time vs. space tradeoffs, trivial mapping from key to integers. Hash tables: definition, INSERT/SEARCH/DELETE operations. Hash functions, collisions. External chaining |
Resources | Lesson recording is available on
this Zoom link Passcode: q&Qn5ff6 this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
12 April 2021 | |
---|---|
Topics |
Hash tables: external chaining vs open probing. Sequential/linear probing, quadratic probing, double hashing. Managing deletions in open probing. Resizing the hash table, doubling and halving the table. Amortized analysis for the number of (re)-insertions. Trees: basic definitions. Binary trees. Binary search trees: definition, searching in a binary search tree. |
Resources | Lesson recording is available on
this Zoom link Passcode: NayY3w@# this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
14 April 2021 | |
---|---|
Topics |
Binary tree visits: pre-order, in-order. post-order visits Height of a binary tree: worst case and best case. Complete binary trees. Max, min, predecessor and successor search in binary search trees. Insertion and deletion in a binary search tree. |
Resources | Lesson recording is available on
this Zoom link Passcode: B@6N7u$s this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
19 April 2021 | |
---|---|
Topics |
Python implementation of Binary Search Tree. The implementation in bstNoRank.py must be modified as follows:
|
Resources | Lesson recording is available on
this Zoom link Passcode:$1Z5dU8G this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
21 April 2021 | |
---|---|
Topics |
Representing binary search trees with dummy leaves. An implementation is available in bstDummy.py Rotations in binary search trees Balanced trees: red-black trees. Definitions, insertions. Worst case performances. |
Resources | Lesson recording is available on
this Zoom link Passcode:e+z13x1Y this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
26 April 2021 | |
---|---|
Topics |
Priority queues. Primitives. Complexity of priority queues primitives on linked lists or balanced search trees Heaps: definition. Insertion and pop_max operations. Complexity. Implementation of heapify. Building a heap in O(n) time An implementation is available in prioritySimple.py An example of use is in UsePrioritySimple.py |
Resources | Lesson recording is available on
this Zoom link Passcode:2aAUgAn# this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
28 April 2021 | |
---|---|
Topics |
Implementation of heaps, with O(n) Algorithm heap sort. Complexity analysis of heap sort. Implementation available in heapSort.py Animation of several sorting algorithms can be seen at https://www.toptal.com/developers/sorting-algorithms |
Resources | Lesson recording is available on
this Zoom link Passcode:C1+5CaS1 this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
3 May 2021 | |
---|---|
Topics |
Graphs: definitions and basic properties
|
Resources | Lesson recording is available on
this Zoom link Passcode:$hPMd&a9 this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
5 May 2021 | |
---|---|
Topics |
Graphs: definitions and basic properties
|
Resources | Lesson recording is available on
this Zoom link Passcode:6=PH4n@= this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
10 May 2021 | |
---|---|
Topics |
Paths, simple paths, walks in a graph Graphs traversals: Depth First search (DFS) and Breadth First search (BFS) Pseudocode of DFS and BFS DFS trees and BFS tree, BFS trees as Single Source Shortest Path (SSSP) trees for unweighted graphs. Hamiltonian paths and Eulerian tours/paths: definitions. Existence of Eulerian tours/paths by vertices degrees. Complexity theory: definition of classes P and NP. The P vs NP conjecture. |
Resources | Lesson recording is available on
this Zoom link Passcode:DdkJ0+r3 this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
12 May 2021 | |
---|---|
Topics |
Dictionaries in Python Representing graphs: adjacency matrix vs. adjacency lists. A Python class implementing graphs by dictionaries: basic version in basicGraphs.py Exercise: add methods for deleting vertices or edges |
Resources | Lesson recording is available on
this Zoom link Passcode:?1P2JbE? this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
17 May 2021 | |
---|---|
Topics |
Subclasses in Python, inheritance Python implementations of BFS visit and DFS visit: Graph.py See the recursive implementation of DFS visit and DFS tree in Graph.py Single source shortest path trees for non-negative weighted graphs: Dijkstra algorithm. |
Resources | Lesson recording is available on
this Zoom link Passcode: du.2+x#D this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
19 May 2021 | |
---|---|
Topics |
Python implementation of Dijkstra's algorithm: updated version of Graph.py using a min priority queue that implements primitive decrease_priority PriorityQueue.pyMinimum spanning tree and minimum spanning forest. Definition of cut. The cut rule. Prim's algorithm. Outline of Kruskal's algorithm and Boruvka's algorithm. |
Resources | Lesson recording is available on
this Zoom link Passcode: HQ0Ri4*e this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |
24 May 2021 | |
---|---|
Topics |
Python implementation of Prim's algorithm for minimum spanning forest: Graph.py Complexity analysis of Kruskal's algorithm Python implementation of Kruskal's algorithm for minimum spanning forest (same Python source code as above). |
Resources | Lesson recording is available on
this Zoom link Passcode: 2$M&bA$@ this video is for personal use only, and is restricted to students of Algorithms and Data Structures course of Statistics Dept., Sapienza. |