Max Rees (they/them)

Lecturer, Department of Computer Science

Purdue University

Spring 2023 — CS 15900

My lectures: view lecture schedule in the table below

My office hours: check Brightspace announcements for cancellations

My office hours for finals week:

TA office hours: check Brightspace announcements for room changes / cancellations

Chapter 1 lectures by William Crum:

Lecture recording playlist (individual recording links are also located below)

Week 1
Mon 09 Jan Tue 10 Jan Wed 11 Jan Thu 12 Jan Fri 13 Jan Sat 14 Jan Sun 15 Jan
Lecture 1 (40:06) Lecture 2 (49:51)
No Lecture Quiz Lecture Quiz Demo
Slides No notes Slides p. 71 – 76
Overview of the class; course policies; motivations. Chapter 2. C program structure; C identifiers; data types: int family, including short, long, and long long. Character data type (char) and ASCII table; boolean data type (bool); floating-point data types (float, double, long double).
Complete Lab 0 + take Lab Quiz 0
Week 2
Mon 16 Jan Tue 17 Jan Wed 18 Jan Thu 19 Jan Fri 20 Jan Sat 21 Jan Sun 22 Jan
No office hours
(MLK Jr. day)
Lecture 3 (49:28) Lecture 4 (47:31)
Lecture Quiz 1 Lecture Quiz 2
Slides p. 76 – 80 Slides p. 81 – 83
Chapter 2 continued. Variables: declaration, definition, and initialization; uninitialized variables and undefined behavior; constants: literal constants, symbolic/defined constants, memory constants; formatted input/output: printf format string and data list; format string placeholders: code, size, precision, (minimum) width, and flag. Chapter 2 continued. Variations of the minimum width modifier for printf() placeholders; usage of scanf() for user input; types of errors: compile-time errors (including syntax errors and the difference between gcc's "errors" and "warnings"), and run-time errors (including crashes such as segmentation faults and floating point exceptions, and logical errors); debugging with diagnostic printf() statements.
Start Homework 1
Start Lab 1 (overview) + take Lab Quiz 1
Week 3
Mon 23 Jan Tue 24 Jan Wed 25 Jan Thu 26 Jan Fri 27 Jan Sat 28 Jan Sun 29 Jan
Lecture 5 (50:46) Lecture 6 (50:00)
Lecture Quiz 3 Lecture Quiz 4
Slides p. 83 – 88 Slides p. 88 – 91
Chapter 3. Expressions; operators; operands; operator precedence; simple and compound assignments; prefix and postfix increment and decrement; side effects and sequence points; undefined behavior; single data type and mixed data type expressions; implicit data type conversions (safe) and hierarchy of data types by relative size. Chapter 3 continued. Explicit data type conversions (can be unsafe) using "type casting" operators; rounding versus truncation with regards to floor(), (int) casts, and printf() precision modifiers; assignment data type conversions (can be unsafe); immutability of object data types; what causes the value of a variable to change (simple or compound assignment operators, scanf(), or prefix/postfix increment/decrement operators); selection by calculation with examples, including the "scaling to zero or one" formula.
Homework 1 due 11:00 PM Start Homework 2
Lab 1 due 30 minutes before lab period
Start Lab 2 (overview) + take Lab Quiz 2
Week 4
Mon 30 Jan Tue 31 Jan Wed 01 Feb Thu 02 Feb Fri 03 Feb Sat 04 Feb Sun 05 Feb
Lecture 7 (49:26) Lecture 8 (49:14)
Lecture Quiz 5 Lecture Quiz 6
Slides p. 92 – 95 Slides p. 95 – 103
Chapter 3 continued. More examples of selection by calculation.

Chapter 4. Purpose of functions; function factoring; functional cohesion; calling function and called function; parameters; return values; function declarations, calls, and definitions.
Chapter 4 continued. void functions; functions with no parameters and no return value (static output); functions with no parameters that return a value (input); functions with parameters that return a value (calculation); functions with parameters and no return value (dynamic output); differences between function declarations, calls, and definitions.
Lab 2 due 30 minutes before lab period
Start Lab 3 (overview) + take Lab Quiz 3
Week 5
Mon 06 Feb Tue 07 Feb Wed 08 Feb Thu 09 Feb Fri 10 Feb Sat 11 Feb Sun 12 Feb
Lecture 9 (49:57) Lecture 10 (49:39)
Lecture Quiz 7 Lecture Quiz 8
Slides p. 104 – 107 Slides p. 107 – 110
Chapter 4 continued. Acceptable main() functions; parameter passing: pass-by-value and pass-by-address; address operator & and dereferencing operator *; pointers and pointer types; swapping the value of two variables.

I don't know why the video is orange, but hopefully it doesn't happen again.
Chapter 4 continued. Final thoughts on scope (local and global, for variables and functions respectively); structure charts: format, rules, good and bad examples.
Homework 2 due 11:00 PM Start Homework 3
Lab 3 due 30 minutes before lab period
Start Lab 4 (overview) + take Lab Quiz 4
Week 6
Mon 13 Feb Tue 14 Feb Wed 15 Feb Thu 16 Feb Fri 17 Feb Sat 18 Feb Sun 19 Feb
Lecture 11 (47:43) Lecture 12 (46:38)
Lecture Quiz 9 Lecture Quiz 10
Slides p. 111 – 114 Slides p. 114 – 117
Recommended problem-solving method (specify, analyze, design, code, test and debug, refine); overview of the current position in the class's content: just finished sequence with chapter 4; next is selection in chapter 5; then repetition in chapter 6.

Chapter 5. Logical data (true or false); logical expressions; C convention for true and false values ("truthiness"); logical operators: NOT (!), AND (&&), OR (||); truth tables; short-circuiting; simple examples of logical NOT, AND, and OR; examples of short-circuiting with side effects.
Chapter 5 continued. Relational operators (< <= > >=) and equality operators (== !=); compound statements; logical complements.
Lab 4 due 30 minutes before lab period
Start Lab 5 (overview) + take Lab Quiz 5
Week 7
Mon 20 Feb Tue 21 Feb Wed 22 Feb Thu 23 Feb Fri 24 Feb Sat 25 Feb Sun 26 Feb
Lecture 13 (48:46) Midterm 1: 08:00 – 09:00 PM, Hall of Music Lecture 14 (46:30)
Lecture Quiz 11 Lecture Quiz 12
Slides p. 118, 120 – 121 Slides p. 122 – 127
Chapter 5 continued. Examples of logical complements; two-way selection using the if/else construct.

Unlucky number 13! Not only did the AV system completely fail for my second lecture that day, there is also a small issue with this recording: the announcement slides at the beginning may not be visible if you watch from a mobile device. If you're using a laptop or desktop, you should be able to switch streams and view it. In any case, the slides are also posted separately as usual.
Chapter 5 continued. Nested selection with if/else; "dangling else" logical error; two-way selection using the conditional expression (also known as the ternary conditional operator); multi-way selection using if/else if/else.
Homework 3 due 11:00 PM Start Homework 4
Lab 5 due 30 minutes before lab period
Start Lab 6 (overview) + take Lab Quiz 6
Week 8
Mon 27 Feb Tue 28 Feb Wed 01 Mar Thu 02 Mar Fri 03 Mar Sat 04 Mar Sun 05 Mar
Lecture 15 (51:11) Lecture 16 (50:07)
Lecture Quiz 13 Lecture Quiz 14
Slides p. 127 – 131 Slides p. 132, 135 – 138
Chapter 5 continued. Final thoughts on if/else if/else; switch construct: case labels and break statements; "fall-through" behavior of switch; comparing floating-point values for equality; C language rules for switch; when and how to use switch. Chapter 6. Repetition using loops: loop control expression (LCE), loop control variable (LCV), loop initialization and loop update, loop iterations; pre-test versus post-test looping constructs: the minimum number of iterations and when to use each; tabular strategy for analyzing looping code; event-controlled versus counter-controlled processes; input validation as a event-controlled process using a post-test looping construct; while and do-while loops.
Lab 6 due 30 minutes before lab period
Start Lab 7 (overview) + take Lab Quiz 7
Week 9
Mon 06 Mar Tue 07 Mar Wed 08 Mar Thu 09 Mar Fri 10 Mar Sat 11 Mar Sun 12 Mar
Lecture 17 (50:48) Lecture 18 (49:09) TA office hours end
Lecture Quiz 15 Lecture Quiz 16
Slides p. 139 – 140, 143 – 146 Slides p. 146, 141 – 142, 147 – 152, 133 – 134
Chapter 6 continued. Implementation of the factorial example; infinite loops and forcing programs to exit using Ctrl-C; introduction to the C for loop and when to use it; examples of rewriting while loops into for loops. Chapter 6 continued. More for loop examples; nested loops and an example using factorials for ranges of numbers; looping example with structure chart, flowcharts, and code: rearranging the digits in a number from largest to smallest; another looping example with structure chart and flowcharts: calculating average, minimum, and maximum for an unknown amount of exam scores.

Note: the slides PDF contains the structure charts and flowcharts for the last two examples.
Homework 4 due 11:00 PM Start Homework 5
Lab 7 due 30 minutes before lab period
Start Lab 8 (overview) + take Lab Quiz 8
Spring break
Mon 13 Mar Tue 14 Mar Wed 15 Mar Thu 16 Mar Fri 17 Mar Sat 18 Mar Sun 19 Mar
No lecture No lecture
No labs or office hours
Week 10
Mon 20 Mar Tue 21 Mar Wed 22 Mar Thu 23 Mar Fri 24 Mar Sat 25 Mar Sun 26 Mar
Office hours resume Lecture 19 (49:18) Lecture 20 (48:40)
Lecture Quiz 17 Lecture Quiz 18
Slides p. 153 – 155 Slides p. 156 – 160
Chapter 6 continued. Introduction to recursion: recursive cases and base cases; example of recursion with factorials; limitations of recursion (stack overflow); review of repetition techniques. Chapter 8. Introduction to arrays: motivation, concept, declaration and definition, initialization and assignment; iterating over arrays with loops.
Lab 8 due 30 minutes before lab period
Start Lab 9 (overview) + take Lab Quiz 9
Week 11
Mon 27 Mar Tue 28 Mar Wed 29 Mar Thu 30 Mar Fri 31 Mar Sat 01 Apr Sun 02 Apr
Midterm 2: 08:00 – 09:30 PM, Hall of Music Lecture 21 (49:08) Lecture 22 (51:27)
Lecture Quiz 19 Lecture Quiz 20
Slides p. 160 – 167 Slides p. 168 – 170
Chapter 8 continued. Going beyond the limits of an array; arrays across function boundaries: syntax and semantics of passing individual array elements by value and by address, and of passing entire arrays by address; handling of the array name as an address and the index as an offset with respect to that address (hence zero-based indexing); summary of passing various objects (variables, array elements, and arrays) by value, by address, and using the return keyword; printing or scanning entire arrays. Chapter 8 continued. Introduction to efficient usage of arrays: more efficiently reversing the order of elements in an array; introduction to sorting: method of swapping values, unsorted lists and sorted lists, and passes; algorithm for selection sort.
Homework 5 due 11:00 PM Start Homework 6
Lab 9 due 30 minutes before lab period
Start Lab 10 (overview) + take Lab Quiz 10
Week 12
Mon 03 Apr Tue 04 Apr Wed 05 Apr Thu 06 Apr Fri 07 Apr Sat 08 Apr Sun 09 Apr
Lecture 23 (51:20) Lecture 24 (49:26)
Lecture Quiz 21 Lecture Quiz 22
Slides p. 170 – 175 Slides p. 187 – 190
Chapter 8 continued. Finishing up selection sort; algorithm and code for bubble sort; algorithm for insertion sort; summary of sorting algorithms. Chapters 9 & 10. Generalizing addresses and pointer variables from the pass-by-address technique using the address-of operator & and dereferencing/indirection operator *; pointer declaration/definition, initialization, and modification.
Lab 10 due 30 minutes before lab period
Start Lab 11 (overview) + take Lab Quiz 11
Week 13
Mon 10 Apr Tue 11 Apr Wed 12 Apr Thu 13 Apr Fri 14 Apr Sat 15 Apr Sun 16 Apr
Lecture 25 (49:17) Lecture 26 (49:40)
Lecture Quiz 23 Lecture Quiz 24
Slides p. 190 – 194 Slides p. 176 – 179
Chapters 9 & 10 continued. Relationship of arrays and pointers; pointer arithmetic and arrays; memory allocation for dynamically-sized arrays using the stdlib.h function malloc() and the sizeof operator.

Note: the answer to the second lecture quiz question can be found in the "slides" link above.
Chapter 8 continued. Solving problems using sorting algorithms; introduction to searching: sequential search concept and implementation; introduction to binary search.

Note: the recording is from my 9:30 section. Lecture quiz questions 1 and 2 were over selection and bubble sort. Check out this recording (11:22) to review lecture quiz question 3 (insertion sort) from my 8:30 section. There is also a template you can use to solve these questions.
Homework 6 due 11:00 PM Start Homework 7
Lab 11 due 30 minutes before lab period
Start Lab 12 (overview) + take Lab Quiz 12
Week 14
Mon 17 Apr Tue 18 Apr Wed 19 Apr Thu 20 Apr Fri 21 Apr Sat 22 Apr Sun 23 Apr
Lecture 27 (48:00) Lecture 28 (46:42)
Lecture Quiz 25 Lecture Quiz 26
Slides p. 179 – 183 Slides p. 184 – 186
Chapter 8 continued. Binary search: algorithm, examples, and implementation.

Note: the recording is audio-only due to a glitch for the first ~ 5 minutes, which are announcements only. You can find the slides above. The rest of the recording should be OK.
Chapter 8 continued. More sorting questions; multidimensional arrays: concept and motivation, declaration/definition, initialization, usage.

Note: the recording is from my 9:30 section. We did questions 2 and 3. Check out this recording (12:55) to review lecture quiz question 1 from my 8:30 section.
Homework 7 due 11:00 PM
Lab 12 due 30 minutes before lab period
Lab Quiz 13 due at end of lab period
Quiet period (week 15)
Mon 24 Apr Tue 25 Apr Wed 26 Apr Thu 27 Apr Fri 28 Apr Sat 29 Apr Sun 30 Apr
No lecture No lecture TA office hours end
No labs
Finals week (16)
Mon 01 May Tue 02 May Wed 03 May Thu 04 May Fri 05 May Sat 06 May Sun 07 May
No lecture No lecture
No labs or TA office hours
Final Exam: 08:00 - 10:00 AM, Hall of Music

Last modified on Tue 09 May 2023 09:06 AM EDT.