Credits
7.5
Types
Compulsory
Requirements
This subject has not requirements
, but it has got previous capacities
Department
CS
Web
http://www.cs.upc.edu/~jordicf/Teaching/AP2
Teachers
Person in charge
- Jordi Cortadella Fortuny ( jordi.cortadella@upc.edu )
Others
- Jordi Petit Silvestre ( jpetit@cs.upc.edu )
- Pau Fernandez Duran ( pau.fernandez@upc.edu )
Weekly hours
Theory
3
Problems
0
Laboratory
2
Guided learning
0
Autonomous learning
7.5
Competences
Technical competencies
Transversals
Basic
Generic
Objectives
Contents
-
Abstract Data Types.
Specification and implementation. Abstraction, functional and data decomposition, information hiding and encapsulation. Object-oriented languages: classes and objects, private and public methods, constructors and destructors. Genericity. Examples: point, rectangle, rational numbers. -
Algorithm analysis.
Cost in time and space. Worst, best and average case. Asymptotic notation. Analysis of the cost of iterative and recursive algorithms. Examples: insertion and selection sort, maximum subsequence sum, convex hull. -
Divide and conquer.
Principles: partition into subproblems, recombination of solutions. Master theorem. Examples: binary search, merge sort, quick sort, quick select, finding the two closest points in a plane. Fast Fourier Transform (FFT). -
Memory management.
Representation of data in memory. Pointers and references. Dynamic memory management (vector class). Memory layout of a program (code, stack, heap). -
Basic containers.
Operations, usage and implementations of stacks, queues, priority queues and lists. -
Graphs.
Representations: adjacency matrices, adjacency lists and implicit representations. Depth-first search (DFS). Breadth-first search (BFS). Topological sort. Algorithms for shortest paths (Dijsktra, Bellman-Ford). Algorithms for minimum spanning trees (Prim and Kruskal). Algorithms for the maximum flow problem (Ford-Fulkerson). -
Sets and dictionaries.
Trees and their representation. Binary trees and traversals (pre-order, post-order, in-order and level-order). Binary search trees and balanced trees: operations and implementation. Hashing.
Activities
Activity Evaluation act
Theory
5h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
9h
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
Final examination (on paper)
Week: 15 (Outside class hours)
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
Final examination (with computer)
Week: 15 (Outside class hours)
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
Project delivery
Week: 15 (Outside class hours)
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
Theory
5h
Problems
0h
Laboratory
4h
Guided learning
0h
Autonomous learning
12h
Theory
7h
Problems
0h
Laboratory
5h
Guided learning
0h
Autonomous learning
20h
Theory
3h
Problems
0h
Laboratory
2h
Guided learning
0h
Autonomous learning
7.5h
Theory
7h
Problems
0h
Laboratory
4h
Guided learning
0h
Autonomous learning
16h
Theory
9h
Problems
0h
Laboratory
4h
Guided learning
0h
Autonomous learning
21h
Theory
7h
Problems
0h
Laboratory
4h
Guided learning
0h
Autonomous learning
16h
Teaching methodology
The syllabus is presented in a very practical way, through the presentation of many examples.The theory classes introduce all the necessary concepts and techniques, which are put into practice in the classes of problems and laboratory through a collection of problems and exercises in an automatic judge.
Every week, there are two hours of theory classes, one hour of problems and two hours of laboratory.
The course uses C++ and Python as programming languages.
Evaluation methodology
The final grade of the course takes into account the following evaluation acts:* P1: individual programming project to be delivered in mid-course
* P2: programming project (in pairs) to be delivered in at the end of the course
* PL: partial laboratory exam (with computer)
* FL: final laboratory exam (with computer)
* FT: final theory exam (with paper)
The project grade is calculated as: P = (P1 + P2)/2
The exams grade is calculated as: X = max (0.3 PL + 0.4 FT + 0.3 FL, 0.5 FT + 0.5 FL)
The final grade N is calculated as:
* N = max(0.3 P + 0.7 X, 0.15 P + 0.85 X), if X >= 4
* N = 0.15 P + 0.85 X, if X < 4
Students who fail the subject can take the reevaluation exams RL (laboratory) and RT (theory). The grades of these exams will substitute FL and FT, respectively, in the formula of the computation of the final grade.
Bibliography
Basic
-
Algorithmics and Programming II (lecture notes in English)
- Cortadella, Jordi; Petit, Jordi,
UPC,
2021.
-
Data structures and algorithm analysis in C++
- Weiss, Mark Allen,
Pearson,
2014.
ISBN: 9780273769385
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991004000539706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Algorithms
- Dasgupta, Sanjoy.; Papadimitriou, Christos; Vazirani, Umesh,
Mc Graw Hill Higher Education,
2008.
ISBN: 9780073523408
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991003202339706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Introduction to algorithms
- Cormen, T.H. [et al.],
MIT Press,
2022.
ISBN: 9780262046305
-
Fundamentos de algoritmia
- Brassard, Gilles.; Bratley, Paul,
Prentice Hall,
1997.
ISBN: 9788489660007
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991001484479706711&context=L&vid=34CSUC_UPC:VU1&lang=ca
Complementary
-
Introduction to algorithms: a creative approach
- Manber, Udi,
Addison-Wesley,
1989.
ISBN: 9780201120370
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991000704999706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Algorithms in C++
- Sedgewick, Robert,
Addison-Wesley,
1998-2002.
ISBN: 9780201350883
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991002417629706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Algorithms illuminated. Part 1: The Basics
- Roughgarden, Tim,
Soundlikeyourself Publishing,
2017-2020.
ISBN: 9780999282908
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991004186919706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Algorithms illuminated. Part 2: Graph Algorithms and Data Structures
- Roughgarden, Tim,
Soundlikeyourself Publishing,
2017-2020.
ISBN: 9780999282922
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991004186919706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Algorithms illuminated. Part 3: Greedy Algorithms and Dynamic Programming
- Roughgarden, Tim,
Soundlikeyourself Publishing,
2017-2020.
ISBN: 9780999282946
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991004186919706711&context=L&vid=34CSUC_UPC:VU1&lang=ca
Web links
- Pàgina principal del curs. http://www.cs.upc.edu/~jordicf/Teaching/AP2
- Jutge.org https://jutge.org