Week 3 - Linked Lists

Learning objectives

  • Implement common operations, using either iteration or recursion, in a linked list
  • Reason about the efficiency of algorithms working on a array based or linked list

Class Schedule

Monday

  • ArrayLists

Tuesday

  • Linked List intro
  • Start on CPPLabs

Wednesday

Thursday

Topics

ArrayLists

  • Watch:
  • Go back to week 7 of CS162 if you need/want more review on Array based Lists.
  • Do the ArrayList WS

Linked Lists

  • Watch these videos introducing a basic linked list and then some important additions we can make:
  • Read Liang Ch20.0-20.4
Don't underestimate the power of drawing a diagram and running code by hand while you are trying to understand or debug an algorithm. If you can't draw a diagram of a structure, you don't understand it.
  • Start the LinkedList CPPLab

Linked Lists Continued

  • Do the LinkedList Worksheet. It has some pen and paper exercises as well as some link list diagrams you can use for running code by hand as you figure out the CPPLabs.

  • Watch this video on memory management in a linked list:

  • And this video of tips on using the debugger with linked lists:

  • Start the LinkedList - Memory CPPLab

Recursion & Linked Lists

Linked Lists With Recursion

  • Watch this video:

  • Do the LinkedList - Recursion CPPLab. I highly recommend drawing out some pictures while you work on the problems!

Assignment 2

You should already be set to do the first two parts of assignment 2. Get to it! The rest of the material you are learning this week.