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
Schedule your midterm NOW for next week. See discussion board for details!

Day 1

Linked Lists

  • Watch this video introducing a basic linked list class:
  • Watch this video on programming and debugging tips for linked lists:

  • Read Liang Ch20.0-20.4

  • Do the LinkedList Worksheet

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.

Day 2

Linked Lists Tails & Size

  • Watch this video on additions we can make to a Linked List to improve the efficiency of certain operations:
  • Do the LinkedList CPPLab

Linked List Rule of Three

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

  • Do the LinkedList - Memory CPPLab

Day 3

Doubly Linked Lists

Circular Linked Lists, Doubly Linked Lists

  • Watch this video on different kinds of linked lists:

  • Read Liang Ch20.7

  • Do the DLL Worksheet - it will help you think through the code you need for the CPPLabs.

    Having troubles clearly identifying what something like current->prev->next is doing? Watch this video for tips on how to make things more concrete

  • Do the DLL CPPLab

Day 4

Linked List Slicing and Slicing

Watch this video on sorting in linked lists. The most important bit to focus on is HOW we do tasks like slicing a list in half, or transferring data from one list to another, in a linked list. Often times, it will be a very different strategy than is we were using an array based list.

  • Do the LinkedList Slice Steal WS

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.