Course outline (Imperative Programming)
This page gives an outline of the course, supplemented by links to the handouts and problem sheets, and source code for the example programs.
- I will not be using slides, and I will not be handing out a transcript of each lecture, but only a very brief handout, typically containing the text of programs that are discussed in the lecture. Students will be expected to attend the lectures and make their own notes.
- Each problem sheet contains problems on all the material up to the place it appears in this outline, but you should be able to do at least some of the problems before we have finished all the lectures up to that point. I shall be handing out a complete set of problem sheets in a lecture near the start of the course.
- Source code is given for the example programs that are used in the lectures.
 Printing numbers in decimal: handout.
 Method of invariants and proof of termination; String comparison: handout.
 repeat, loop and for statements; introducing Lab 1: handout.
- Source text of program L0Total.m.
- Source text of programs L1Slow.m, L1Fast.m, L1Time.m.
- Source text of program L2Print.m.
- Source text of program L3Find.m.
- Problem sheet 1.
Programming with procedures
 Procedures and parameters: handout.
 Binary search: handout.
 Lab 3 – longest ascending subsequence: handout.
- Source text of program L7Sort.m.
- Problem sheet 2.
Modules and pointers
 Modules; pointer-linked structures: handout.
 Operations on linked lists: handout.
 Doubly-linked lists and priority queues: handout.
 Implementing Dijkstra's algorithm: handout.
- Source text of modules L9Store.m, L9Main.m.
- Source text of modules L10Store.m, L10Main.m.
- Problem sheet 3.
Implementing data structures
 Hash tables: handout.
 Dancing links: handout.
- Source text of module L13Words.m.
- Source text of module L14Words.m.
- Source text of module Pento.m and script pentovision.
- Problem sheet 4.
- Please don't think that I worship the fetish of numbering everything from zero in everyday life: it's just that I decided to add an extra lecture at the start, and didn't want to renumber everything else.