Algorithms and Data Structures 2025/2026 (L.EIC011) - DCC/FCUP & DEI/FEUP

Information for the 1st Practical Test


General Information


Specific goals for each exercise and training problems

  1. [25%] Exercise 1: a simple problem with some algorithmic insight (this exercise will roughly correspond to contents of practical class #01 and #02)
    You will need to solve a simple problem and think about what the algorithm should be. The solution will need a certain complexity to pass all the tests, and you might need to use techniques learned in classes such as sliding windows or prefix sums. Partial score will be given to solutions that are more naive and don't have the desired complexity.  
  2. [25%] Exercise 2: binary search (this exercise will roughly correspond to contents of practical class #03)
    You will need to know how to apply a direct or indirect variation of binary search. Input data will already be sorted. To obtain full score you need to have an \(O(\log n)\) search, but partial score will be given to submissions that use linear search. You can use the C++ library if you want (e.g. lower_bound).  
  3. [25%] Exercise 3: sorting with custom order (this exercise will roughly correspond to contents of practical class #04)
    You will need to know how to apply sorting with a customized order that might depend on more that one parameter. To obtain full score you need to have an \(O(n \log n)\) sort, but partial score will be given to submissions that take quadratic time for sorting or that can only take into consideration one sorting parameter. You can use the C++ library if you want (e.g. sort)  
  4. [25%] Exercise 4: methods in linked lists (this exercise will roughly correspond to contents of practical class #05)
    You will need to add one or more small methods to the singly linked list class given in the lectures and used on practical exercises (class SinglyLinkedList<T>: see code | download code). Partial score will be given if you solve just one of the methods or if you don't have an efficient method with the right complexity.