Previous Lecture lect02 Next Lecture

Code from lecture

We worked through the solutions to the CS16 final exam: CS16 final exam solutions

Topics

We will solve the final exam for CS16 from Fall 2022 as a review of linked list concepts and recursion.

Pre-class prep

  1. Complete the “Get setup with Github” part of lab00: https://ucsb-cs24.github.io/w23/lab/lab00/

  2. Read the description of the 3 functions that we will be implementing:

https://docs.google.com/document/d/1NE5x-oMbf_T52JXRQITjw60Ou66GuO3COLKzFhxsIvg/edit?usp=sharing

  1. Review linked lists from CS16 using the guide below:
    • Why linked list? Array (doesn’t really work because fixed size). Better options: vector and linked list
    • Implement a linked list (C-style) no classes, focussing on the concept of creating and modifying a linked chain
    • Create an empty list and write a function to append a new node to the linked list
    • Print the elements of the list: key concept includes iterating over the nodes of the linked list using a traversal pointer
    • Write linked list functions that use recursion: recursively print values, clear all nodes, delete a particular value