Lecture 16: May 8, 2023

Reading: zyBooks text, §10, 8.6–8.7
Assignments: Homework 2 and Extra Credit 2, due May 10

  1. Announcements
    1. Class on Wednesday, May 10 is in person
    2. Midterm is Friday, May 12, in person

  2. How to write a recursive program
    1. Recursive selection sort (sort.c)

  3. Dynamic memory allocation
    1. Library functions malloc, realloc. calloc, free
    2. Example: change sort.c to handle any number of numbers (usort1.c)

  4. Structures
    1. User-defined datatype for grouping data
    2. As fields: var.field, ptrvar–>field
    3. Use example of list of numbers (usort2.c)
    4. Do insertion sort (linked.c)

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 36A, Programming & Problem Solving
Version of May 7, 2023 at 8:40PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh