Subjects Fundamentals

The course allows the student to acquire adequate knowledge and skills in algorithms, data structures and their implementation in C to solve complex problems. The student should gradually evolve from more analytic to more design-oriented skills. Algorithmic solutions to 'classical' problems are introduced, together with their theoretical foundations, and the implementations in C language. Advanced aspects of C are considered, like pointers, dynamic memory allocation, modularity and Abstract Data Type implementation. The student has the opportunity to analyze practical examples, describing solutions to complex problems, and the related algorithmic paradigms. Knowledge and programming skills are applied during lab sessions.

 

Expected Learning Outcomes

·         Knowledge of techniques for memory allocation and use of pointers.

·         Programming skills in C language, using pointers and dynamic data structures.

·         Knowledge of basic complexity analysis.

·         Knowledge of sorting algorithms.

·         Ability to evaluate algorithm complexity and improve efficiency in terms of execution time and/or memory use.

·         Knowledge of complex data structures and ADTs (linked lists, queues, stacks, heaps, trees, hash tables and graphs) and related algorithms.

·         Knowledge of simple strategies for modular programming in C.

·         Knowledge of recursive and greedy problem-solving paradigms.

·         Skills in problem solving, based on design of data structures and algorithms.

·         Skills in recursive programming techniques.

·         Skills to exploit tools for program development.

 

Prerequisites

Due to the incremental nature of the course with respect to the first year class “Computer Science”, there are several strict prerequisites in terms of programming skills and programming language knowledge, with particular emphasis on the following topics:

·         Elementary computer systems architecture (Von Neumann model).

·         Syntax of C, basic data types and constructs.

·         Basic programming skills in C, using conditional and iterative constructs, scalar and aggregate data, standard I/O, text files and functions.

·         Skills in elementary (algorithmic) problem solving.

 

Contents

·         Review of basic language construct and basic problem solving (11h)

·         Algorithm analysis (5h)

o   Asymptotic worst-case complexity analysis

o   O, W, Q notations

o   Recurrence equations

·         Sorting algorithms (8h)

o   Iterative sorting (bubble sort, selection sort, insertion sort, shell sort, counting sort)

o   Recursive sorting (mergesort, quicksort, heapsort)

·         Static and dynamic data structures and their implementation in C (15h)

o   Data representation in memory and runtime memory management

o   Pointers (or references to objects)

o   Static, on stack and dynamic memory allocation

o   Linked structures

o   Strategies for data structure selection

·         Modularity and modular implementation of algorithms and data structures (10h)

o   The implementation-interface-client model

o   Implementation in C of programs with multiple source and header files

o   Basic use of development and debug tools, like make, gdb, cvs

·         Recursion and recursive programs (10h)

o   The notion of recursion

o   Mathematical recursive functions

o   Simple recursive procedures

o   Backtrack and implementation of recursion

·         Discrete mathematics (4h)

o   Sets, relations, functions

o   Lists, graphs and trees

·         Abstract objects, collections of objects and ADTs (10h)

o   Modular examples of composed structures, like arrays of lists and multilists

o   Linked lists, stacks, FIFO queues, generalized queues, priority queues, heaps

·         Algorithmic paradigms (8h)

o   Divide and conquer

o   Greedy

·         Problem solving (14h)

o   Analysis and definition of strategies for data structures and algorithms

o   Search and optimization problems

o   Techniques to explore the state space based on combinatorics

·         Data structures for symbol tables (10h)

o   Binary search trees

o   Hash tables

·         Graph theory (15h)

o   Graph representation

o   Depth-first and breadth-first search and their applications

o   Shortest paths

o   Minimum spanning trees.

 

Delivery Modes

Lectures (80h) include practice lessons. Lectures and lab sessions (20h) are extended with 20 additional hours in class or lab to consolidate what the student has learned. Selected lab sessions may be ranked and contribute a bonus (max 2/30).

 

Texts, Readings and Handouts

Handouts and slides used during the classroom lessons are available on the teacher or course WEB site.

The World Wide Web is also an excellent source of material for almost all topics introduced in the class (see Wikipedia, for example).

Among the printed material, during the class, we make explicit usage of the following books:

·         R. Sedgewick, “Algorithms in C, Parts 1-4: Fundamentals, Data Structures, Sorting, Searching” and “Algorithms in C, Part 5: Graph Algorithms”, Addison-Wesley Professional

·         T. H. Cormen, C. E. Leiserson, R. L. Rivest, C. Stein, “Introduction to Algorithms”, McGraw-Hill.

·         B. W. Kernighan, D. M. Ritchie, “The C Programming Language”, Prentice Hall, second edition.

·         P. Deitel, H. Deitel, “C: how to program”, Prentice Hall, eight edition.