IP
Imperative Programming
Objectives
This course presents the imperative programming paradigm to students that already took a course on (functional) programming. In this context, for many of the algorithms presented, the focus is in the imperative implementation of these algorithms, namely as state based procedures. At the end of the course the students should be able to: ● Decompose a problem into smaller problems ● Define types to represent the data and results of a program ● Write procedures to sort and search an array ● Define dynamic structures able to represent the information of a program
Program
- Introduction to the imperative programming paradigm: state and memory model
- Automatic memory: definition of functions and argument passing mechanisms
- Recursive and iterative definition of functions over arrays (search and sort)
- Dynamic memory (heap). Definition of recursive data types (lists and trees)
- Persistent memory: use of sequential and random access files to preserve (parts of) the state of a program.
Bibliography
Kernigham, B. W., Ritchie, D. M. (1988). The C programming language (2nd ed.). Prentice Hall Software Series. Donald E. Knuth. The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition. Addison- Wesley, 1973. Robert Sedgewick. Algorithms in C: parts 1-4, Fundamentals, Data Structures, Sorting, and Searching, third edition. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1997.