.. _module2: ************************************************************************************************************************************* Module 2 | Complexity, Recursive Programming, Arborescent data structures, Basic algorithms, Invariants and proof of correctness ************************************************************************************************************************************* Objective ========= By the end of this module, students will be able to: * Use (and explain) spatial and temporal complexity concepts, along with the mathematical tools used to describe them (big-Oh/Omega/Theta notations and definitions). * Analyse complex algorithm and derive their complexity * Code a binary search * Code the merge sort algorithm * Explain the RAM model * Use recursive programming * Use arborescent data structures (trees, lists, ...) * Use invariants to show both correctness and complexity of an algorithm Resources ======================================= * `Lecture 2a Complexity Slides `_ * `Lecture 2a Complexity Videos `_ * `Youtube Live `_ Q&A Session * `Course 2b Abstract Data Types and Proof of Programs Slides `_ * `Lecture 2b Abstract Data Types and Proof of Programs Videos `_ * `Youtube Live restructuration 2020 `_ Q&A Session * `Restructuration 2021 `_ Q&A Session Exercises: week 1 ======================================= 1. `Time Complexity simple MCQ `_ 2. `Space Complexity MCQ `_ 3. `Array Search `_ 4. `Merge Sort `_ 5. `Largest Sum Contiguous Subarray `_ Exercises: week 2 ======================================= 1. `Recursion Fibonacci `_ 2. `Bubble Sort Invariant `_ 3. `Recursion Hanoi Tower `_ 4. `Longest Valley in an Array `_ 5. `Implement a stack with a queue `_ 6. `Implement a circular linked list `_ 7. `Implement a queue with two stacks `_ 8. `Implement an array list `_