Michael Loceff's Modules
These modules were originally written by Michael. This is my snapshot from several quarters ago. Just like C++ itself, most of the material is still relevant and provided for easy reference here.
The most recent version of these modules could be found in many places online. I found a copy at our CS Club site, which may be about the same version as mine. These are for your benefit only. I only fix the odd serious typos.
Almost every topic we cover in CS2B can be found in Michael's material. Once you locate what you want, simply bookmark it in your browser. I left the Week numbers in the module headings intact. They are an approximate map to the sequence in which we cover topics in the course. But they are not exactly 1-1. So exercise your good judgement in deciding what to read when.
Happy Hacking,
&
Module 1A - Introduction to Data Structures
- Downloading the ADT Files
- Why We're Here
- Timing is everything
- Our First Lab Rate: iTunes
- Search: The First Main Task
- Inserting and Sorting
- Analysis
- An Algorithm
- Special Mac User's Section
Module 1B - Templates and STL
- Function Templates
- vectors
- Iterators
- Benchmarking STL vector
- vectors versus Arrays: The Listing
- A Step Towards Generics
- A Review of Class Templates, Continued
- Applying the Templates to Other Types
- Application to the Subset Sum Problem
Module 2A - Implementing Vectors From Scratch
- A Constant Cause of Compiler Errors
- The First Real C++ Data Structure Project
- Pushing to and Popping from a Vector
- Using and Benchmarking vectors
Module 2B - Implementing Lists and Sparse Matrices
- Linked Lists
- Phase 1 Implementation (Without Iterators)
- Adding Iterators
- Completing the FHlist Class
- Building on Top of ArrayLists - Stacks
- Building on Top of lists: An iTunes Application
- Sparse Matrices
Module 3A - Time Complexity
- Big Oh
- Getting a Tighter Fix on Growth Rates
- Big-Oh Estimations From Code
- Theta Estimations From Code
- Testing the Theory
Module 3B - Recursion; Log and Exponential Time
- Analyzing Binary Search
- Logarithmic Running Times
- Exponential Running Times
- Stars Near Earth
- Stars on Your Console
Module 4A - The General Tree
- General Trees
- Analysis of Recursive Tree Methods
- Traversals and Functors
- Deep Copies, Copy Constructor and Assignment
Module 4B - Binary Search Trees
- Binary Trees
- Binary Search Tree Completed
- Searching Project Gutenberg
- Analysis and Discussion of BSTs
- Lazy Deletion
Module 5A - AVL Trees
- AVL Trees
- Single Rotation Practice
- Double Rotation
- Implementing Rotation
- Implementing Insertion
- Implementing Removal
Module 5B - More AVL and Top-Down Splaying
- Inheritance and Generics
- Completion of the AVL Tree Implementation
- Threaded Binary Trees
- Top Down Splaying
- Splay Pictures
- Splay Algorithms and Closing Remarks on Trees
Module 6A - Separate Chaining Hash Tables
Module 6B - Linear and Quadratic Probing
Module 7A - Priority Queues and Bin Heaps
- Priority Queues and Binary Heaps
- Implementing Binary Heaps
- Remove and Percolate Down
- Order Heap and the Array Constructor
Module 7B - Heap Timing and Heap Sort (Part 1)
Module 8A - Non-NLogN Sorts: Insertion and Shell
Module 8B - NLogN Sorts: Mergesort and Heapsort
Module 9A - Quicksort and Indirect Sorting
- Quicksort
- Coding Quicksort
- Quicksort Observations
- Indirect Sort
- Smart Pointers
- Indirect Sort Completed
Module 9B - STL Survey: Sets, Maps, Priority Queues & More
Module 10A - Graph Theory Basics and a Working Template
- Motivating the Graph
- Minimum Spanning Trees
- Graph Data Structures
- The FHvertex
- The FHedge
- The FHgraph