[FrontPage] [TitleIndex] [WordIndex

Note: You are looking at a static copy of the former PineWiki site, used for class notes by James Aspnes from 2003 to 2012. Many mathematical formulas are broken, and there are likely to be other bugs as well. These will most likely not be fixed. You may be able to find more up-to-date versions of some of these notes at http://www.cs.yale.edu/homes/aspnes/#classes.

As always, the future is uncertain, so you should take parts of the schedule that haven't happened yet with a grain of salt.


Introduction. What the course is about. Getting started with C: running the compiler, the main function, declaring variables, simple input and output, start of control structures (if/else, while and for loops). Readings: WhyYouShouldLearnC, HowToCompileAndRunPrograms, HowToUseTheComputingFacilities, C/Variables, C/IntegerTypes, C/InputOutput, C/Statements; KernighanRitchie §§1.1–1.5, plus 3.1–3.3 for more details on if statements and §3.5 for more details on while and for loops.


Arithmetic. Floating-point types. Relational, logical, bitwise, and assignment expressions. Operator precedence. Readings: C/IntegerTypes, C/FloatingPoint, C/Precedence; KernighanRitchie Chapter 2.


More control structures (do..while loops, break and continue, switch and goto, nested loops). Basics of functions. Readings: C/Statements, C/Functions; KernighanRitchie rest of Chapter 3, §§1.7–1.8.


Pointers and pointer arithmetic. A little bit about arrays, malloc and free, and C99 variable-length arrays. Readings: C/Pointers; KernighanRitchie §§1.6, 5.1, 5.3, and 5.4; HorowitzEtAl §1.2. All lectures will be in DL 220 starting from this date.


Pointers as function parameters and return values. Pointers to pointers and multidimensional arrays. A tiny bit about strings and the true meaning of argv. Readings: KernighanRitchie §§5.2, 5.6, 5.7, 5.9, and 5.10; HorowitzEtAl §2.1–2.2.


Strings, character arrays, passing arrays in and out of functions, const and restrict. Readings: C/Strings; KernighanRitchie §§1.9, 5.5, 2.4.


structs, unions, and enums. Basics of abstract data types and use of opaque struct pointers for information hiding. Readings: C/Structs, C/Definitions, AbstractDataTypes; KernighanRitchie §§6.1, 6.2, 6.4, 6.8, and 2.3; HorowitzEtAl §2.3.


More about abstract data types. Use of typedef. Compiling programs across multiple files; use of make. Readings: AbstractDataTypes, HowToUseTheComputingFacilities section on Makefiles; HorowitzEtAl §1.4; KernighanRitchie §6.7.


Guest lecture by Debayan Gupta: Debugging C programs. Readings: C/Debugging.


Guest lecture by Xueyuan Su: Asymptotic notation and program efficiency. Linked lists. Readings: LinkedLists; HorowitzEtAl §§1.5, 4.1–4.3.


Dictionary types and hash tables. Readings: C/HashTables; HorowitzEtAl §8.2.


Recursion vs iteration. Readings: C/Recursion.


Recursive data structures: binary trees. Readings: BinaryTrees, BinarySearchTrees, BalancedTrees, C/AvlTree; HorowitzEtAl §§5.1–5.3, 5.7.


Heaps. Also a very brief discussion of function pointers. Readings: Heaps; HorowitzEtAl §5.6, KernighanRitchie §5.11.


Function pointers and applications. Readings: C/FunctionPointers, C/Iterators.


Exam 1 was given Thursday, 2012-03-01, in class. It was a closed-book, cumulative exam covering all material discussed in lecture up to that date. Sample solutions: exam1-2012-solutions.pdf, exam1-2012.pdf. Sample exam from 2005: exam1-2005.pdf, exam1-2005-solutions.pdf


Randomization in C. Readings: C/Randomization.


Randomized data structures: skip lists, universal hash families. Readings: rest of C/Randomization.


Radix sorting and radix search. Readings: RadixSort, RadixSearch; HorowitzEtAl §§12.3.1–12.3.8.


Dynamic programming. Readings: DynamicProgramming.


Graphs: representing a graph; depth-first search and applications. Readings: C/Graphs; HorowitzEtAl §§6.1, 6.2.1, and 6.2.3.


More graph searching: breadth-first search, Dijkstra's algorithm for shortest paths, extension to A*. Readings: ShortestPath; HorowitzEtAl §§6.2.2 and 6.4.1.


Effect on data structures of the memory hierarchy. B-trees. Readings: BTrees; HorowitzEtAl §11.2.


String searching and suffix arrays. Readings: SuffixArrays.


A bit of C++. Readings: C++.


Exam 2 was given Thursday, 2012-04-19, in class. It was a closed-book, cumulative exam covering all material discussed in lecture up to that date. Sample exam from 2005: exam2-2005.pdf, exam2-2005-solutions.pdf. Exam and sample solutions: exam2-2012.pdf, exam2-2012-solutions.pdf.

2014-06-17 11:58