CS140 -- Lecture Notes


If I cover a significant amount of material that is not in the book, I will provide lecture notes for the material, and include it here. I will also try to keep track of what the lecture material is for each day here.

  • Differences between C and C++
  • Pointers and I/O using the fields library
  • Linked lists
  • Using the dllist library
  • Stacks and queues
  • The C++ Standard Template Library
  • Basic Algorithm Analysis
  • Binary trees: search trees, AVL trees, splay trees
  • Binary trees: writing binary tree code
  • Hashing
  • Sorting (if time permits)


    Reading Assignments/Lecture Notes

    Important: The dates and the assigned readings are tentative until a few days before the actual class so you should make sure you check this site regularly.

    DateTopicBook ReadingsOnline Notes
    8/21Introduction and review of compilationKochan: Ch. 3, Ch 15: 333-342notes
    8/26C I/OKochan: 347-368notes
    8/28C StringsKochan: Ch. 10Pointers and String Functions
    9/2C PointersKochan: Ch. 11 C types and pointers, plus some hexidecimal
    9/4More string functions and gdbKochan: Ch 18none
    9/9StructsKochan: Ch 9Structs
    9/11File I/O and getlineKochan: pg. 368C I/O
    9/16Fields LibrarynoneFields
    9/18 Singly Linked Lists Weiss 3.1-3.2 All types of linked lists
    9/23 Doubly Linked Lists Weiss 3.1-3.2 All types of linked lists
    9/25 Midterm The exam and its solutions  
    9/30, 10/2 Unions and Generic Pointers Kochan 375-378
    1. Wikipedia's Unions
    2. Jim Plank's notes on Unions
    3. Wikipedia's Void *'s with particular emphasis on Section 9.3.
    4. Jim Plank's notes on Void *'s
    10/7 Stacks Weiss 3.3 Wikipedia's Stacks
    10/9 Fall Break    
    10/14 Queues Weiss 3.4 Wikipedia's Queues
    10/16, 10/21 Analysis of Algorithms Weiss Chapter 2  
    10/23 Intro to trees and binary search trees
    • Introduction to trees: Weiss 4.1-4.2
    • Binary Search Trees: Weiss 4.3
    Binary Search Trees. I need to update
    this notes to use a void * instead of a JVal as
    the type of the value field. When you read the notes, think of the
    value field of a node as being a void *
    10/28 Midterm    
    10/30 Binary Search Trees Weiss Chapter 4.3  
    11/4 Midterm Results Midterm Answers
    11/6 Splay Trees Weiss Chapter 4.4-4.5  
    11/11 Function Pointers    
    11/13 AVL Trees Weiss Chapter 4.4 AVL applet
    11/18 Hashing and Bit Manipulations Weiss Chapter 5.1-5.3 Bits
    11/20 Open addressing and rehashing Hashing: Weiss 5.4-5.5  
    11/25 Heaps Weiss: 6.1-6.3  
    12/11 Final Exam, 12:30-2:30pm Open Note, Open Book