CPSC 221: Basic Algorithms and Data Structures
2015 Winter Term 2
Lab/Lecture Notes


Home Learning Goals Schedule Administration Readings Lab/Lecture Notes Assignments Computing UBC Connect

  • Handouts for the course as a whole
  • Lab handouts/materials
  • Section 201 (Kotthoff, MWF 10am) handouts/materials
  • Section 202 (Hu, MWF 4pm) handouts/materials
  • Old CPSC 221 lecture recordings -- optional and just for your reference, only accessible from ubcsecure wireless or a UBC VPN
  • (Assignments are available from the assignments page.)

    Handouts for Everyone!

    Here are some possibly-helpful notes:

    Lab Handouts

    Lab Resources Date
    Labs start Monday, January 11. Check back for lab material.
    Lab 1: An Introduction to Programming and Compiling in C++ Jan 11 - Jan 15
    Lab 2: Debugging an Insertion Sort program, and Analyzing C++ pointers and reference parameters
    • lab2.zip contains all the files you need for this lab
    • In the first part of the lab, you need to find the bugs and fix them. Only insertion.cc needs to be changed.
    • After doing the second part ("fill in the blanks") you can verify your answers using a program you can compile with "make pointers".
    • The third part is optional, for those that want a deeper understanding. There are no bonus points.
    Jan 18 - Jan 22
    Lab 3: C++ Class and Linked Lists
    • lab3.zip contains all the files you need for this lab
    • First, you'll complete some function members of a simple C++ Class. (Read the "helpful links" to save yourself some time.)
    • Next you'll code three functions that manipulate Linked Lists.
    • The third part is optional, but recommended.
    Jan 25 - Jan 29
    Lab 4: Heaps
    • binaryHeap.cpp is the only file you will need for this lab
    • First, you will implement three functions operating on binary heaps.
    • Next, you'll analyze the asymptotic runtime of your solutions to two of these functions.
    • Check out your notes on binary heaps if you're stuck.
    Feb 1 - Feb 5
    Lab 5: Binary Search Trees
    • lab5.zip contains all the files you need for this lab
    • This week you'll be working with the Binary Search Tree data structure. You may find it useful to familiarize yourself with them before lab, so we've provided some links that should help you out.
    Feb 8 - Feb 12
    Lab 6: Quicksort
    • qsortCount.cc is the C++ source that you'll use for this lab.
    • Click the Quick Sort button on this Visualizer for a demo.
    Feb 29 - Mar 4
    Lab 7: Hashing
    • hash.zip contains all the files you need for this lab
    • Linear, Quadratic and Double Hashing are demonstrated on this Hashing Visualizer.
    Mar 7 - Mar 11
    Lab 8: AVL Trees
    • lab8.zip contains all the files you need for this lab.
    • Try out this AVL tree Visualizer. Click the Options button to do the rotations manually, or go step by step.
    Mar 14 - Mar 18
    Lab 9: Parallelism
    • lab9.zip contains all the files you need for this lab
    • Run your code on the ugrad servers so you don't have to copy the large sample text files
    • This is the last lab assignment of the term!
    Mar. 21 - Mar 25

    Section 201 (Kotthoff, MWF 10am) Handouts

    Section 202 (Hu, MWF 4pm) Handouts

    I will try to post my lecture slides before they are presented in class, usually by at least the day before. However, sometimes I make changes just before (or during!) lecture, in which case, I will update them afterwards.

     

    cs221@ugrad.cs.ubc.ca
    Last Modified: Fri 27 Feb, 2015