Sonoma State University
 
Algorithm Analysis
Instructor: Henry M. Walker

Lecturer, Sonoma State University
Professor Emeritus of Computer Science and Mathematics, Grinnell College

Although CS 415 has been well developed for several years, last year the CS faculty made a significant, long-term curricular change regarding SSU's Upper Division GE Area B Requirement.

Tentative Class Schedule

Tuesday Thursday
January 21
Getting Started
  • Start of classes
  • Introductions
  • Quick Course Overview
  • Home Page / Syllabus / Schedule
  • Class format and expectations
  • Academic honesty: the need for careful citations and complete references/common outcomes for dishonesty
  • Clicker set up
  • Status Check—where are we really?

Introduction to Algorithmic Analysis
  • Getting Started
  • Straight Selection Sort

Reading:
  • Levitin: Chapter 1: Introduction to Algorithms
    • Algorithmic Problem Solving
    • Problem types
    • Fundamental Data Structures
January 23
Functions, Growth Rates, Most Significant Terms
  • Graphs of common functions
  • Function sizes for large input values
  • O-notation, Ω-notation, Θ-notation

Examples of Algorithmic Analysis
Reading:
  • Levitin: Chapter 2: Analysis Fundamentals
    • 2.1 The Analysis Framework
    • 2.2 Asymptotic Notations: O-notation, Ω-notation, Θ-notation
    • 2.3 Analysis of nonrecursive algorithms

Assignment on Analysis of Non-recursive Algorithms
Due: Thursday, January 30
January 28
Maintenance in the Software Life Cycle
Algorithmic Analysis via Experimentation
  • Simulations
  • Timing Algorithms

Reading
January 30
Recursive Algorithms
  • Recursive Algorithms
  • Recurrence Relations
  • Solving [some] Recurrence Relations

Reading
  • Levitin: Recursion: Relations and Algorithms
    • Appendix B: Recursive algorithms and recurrence relations
    • 2.4 Analysis of recursive algorithms

In-class Quiz #1

Assignment on Analysis of Non-recursive Algorithms, Recursive Relations, and Program Format
Due: Thursday, February 6
February 4
Analysis of Recursive Algorithms
  • Identifying Several Recursive Patterns
  • The Master Theorem
  • Examples (e.g., Selection and Permutation Sorts, Sequential Search)

Reading
  • Levitin: Chapter 2: Recursive Algorithms and Analysis
    • 2.4 Analysis of recursive algorithms
    • 2.5 Example: the nth Fibonacci Number

Decrease and Conquer
  • Linear Search
  • Insertion Sort
February 6
Introduction to Assertions
  • Pre- and Post-Conditions
  • The assert statement in C and C++
  • Checking assertions with conditionals and functions

Readings:
Assignment on Recursive Algorithms, Insertion Sort, and Assertions
Due: Thursday, February 13
February 11
Graphs and Internal Representations
  • Graphs
    • Storage of vertex information
    • Storage of edges using adjacency matrices
    • Storage of edges using adjacency lists
    • Breadth-first and Depth-first Searches
  • Efficiency

Loop Invariants: singly-nested loops
  • Assertions for loops
  • Example: Binary Search with Variations
  • Example: Reversing a List

Reading:
February 13
Loop Invariants with Nested Loops
  • Applications of Loop Invariants
    • Straight Selection Sort
    • Insertion Sort

Readings:
  • Levitin:
    • 3.1 Selection Sort

In-class Quiz #2

Assignment on Graph Basics and Invariants for Singly-nested Loops
Due: Thursday, February 20
February 18
Loop Invariants/Divide and Conquer Algorithms
  • Quicksort and Partition Procedure
  • Other applications of loop invariants

Graphs and Topological Sorting
  • Topological sorting
  • Efficiency
Readings:
  • Levitin:
    • 4.2 Topological sorting
February 20 Readings:
More about Quicksort
  • Quicksort and Partition Procedure
Assignment on Topological Sorting, Partition, and Quicksort
Due: Thursday, February 27
February 25
Test 1

(February 25)
February 27
Films and Responses: Outside Class Activity
  • Comparison of Sorting Algorithms
  • RSA Encryption
  • Challenges of Big Data and Computing


Assignment involving Films
Email responses by Thursday, March 6
March 4
Brute Force and Exhaustive Search
  • Examining All Possibilities
    • Linear Search
    • Printing elements on a linked list
      • in order
      • in reverse order
    • Permutation sort
    • Traveling Salesperson Problem
  • 3.2 Sequential Search
  • 3.4 Exhaustive Search
March 6
Notes on Test 1

Divide-and-Conquer
  • Merge Sort

Readings:
In-class Quiz #3

Assignment on Brute Force Algorithms and Merge Sort
Due: Thursday, March 13
March 11 Transform and Conquer
  • Heaps
    • Heap Abstract Data Type
    • Array Implementation

Readings:
  • Levitin:
    • 6.4 Heaps

Transform-and-Conquer
  • Heap Sort

Algebraic Manipulation for Efficiency
  • Horner's Rule

Reading
  • Levitin:
    • 6.4 Heaps and Heap Sort
    • 6.5 Horner's Rule
March 13
Reflections on Topics to Date
  • Preliminary Topic List
    • Algorithmic Analysis, Big-O, Big-Θ, Big-Ω
    • Some Algorithmic Patterns
    • Basics of Graphs
    • Loop Invariants for Binary Search and Partition
    • Quicksort, Improved Quicksort, and Analysis
    • Merge Sort, Heaps, and Heap Sort

In-class Quiz #4

Assignment on Heaps, Sorting, and Using Algebra to Improve Efficiency
Due: Thursday, March 27
March 18 Spring Break (Tuesday, March 18) March 20
Spring Break (Thursday, March 20)
March 25
Notes from solutions to Test 1

More Algebra for Efficiency
  • Binary Exponentiation

Space and Time Trade-offs: Dynamic Programming
  • Approach for Dynamic Programming
  • Example: Computing nth Term of the Fibonacci Sequence
  • Example: Computing Combinations: n choose k

Reading
  • Levitin:
    • 6.5 Binary Exponentiation
    • 8.1 Dynamic Programming with Example
March 27
Hashing
  • Open Hashing (Separate Chaining)

Hashing
  • Closed Hashing (Open Addressing)

Reading:
  • Levitin:
    • 7.3 Hashing

Assignment on Binary Exponentiation, Dynamic Programming, and Hashing
Due: Thursday, April 3
April 1
Hashing
  • Efficiency Analysis for Hash Tables

Numeric Data Representation
  • Accuracy
  • Overflow and underflow
  • Non-associativity for Floating-point numbers

Reading:
April 3
Some Consequences of Numeric Data Representation
  • Writing Boolean expressions (e.g., in conditional statements, loops)
  • Finding middle elements within array segments
  • Accumulating floating-point error in loops
  • The Trapezoidal Rule
Reading:
In-class Quiz #5

Assignment on Consequences of Numeric Representation
Due: Thursday, April 10
April 8 Numerical Approximation Algorithms
  • Bisection method
  • Newton's Method

Reading:
Greedy Techniques
  • Minimum-cost spanning tree
  • Single-source shortest paths (Dijkstra's Algorithm)

Reading:
  • Levitin:
    • 9.1 Prim's algorithm (minimum cost spanning tree)
    • 9.3 Dijkstra's algorithm (single-source shortest paths)
April 10
Greedy Techniques
  • Huffman trees and codes
  • Limitations of Greedy Techniques (e.g., hill climbing)

Reading:
  • Levitin:
    • 9.4 Huffman trees and codes

Assignment on Greedy Algorithms
Due: Thursday, April 17
April 15
Time to catch up
April 17
Test 2

Computer-Science-Specific Report Assignments Posted on Canvas
April 22
Notes from solutions to Test 2

Graph Approximation Methods
  • Branch and Bound
  • Twice around the Spanning Tree

Reading:
  • Levitin:
    • 12.1 Backtracking
    • 12.2 Branch-and-bound

Signature Project
  • Introduction
  • Discussion of Requirements
  • Question and Answer Session
April 24
Graph Approximation Methods, Continued
  • Branch and Bound
  • Twice around the Spanning Tree

Reading (Continued):
  • Levitin:
    • 12.2 Branch-and-bound
    • 12.3 Discussion of "Minimum-Spanning-Tree–Based Algorithms:

Signature Project
  • Discussion, Continued
  • Help for Individual Students, as needed

Assignment on Approximation Methods
Due: Thursday, May 1
April 29
Graph Approximation Methods—Wrap up as needed
  • Branch and Bound
  • Twice around the Spanning Tree

Signature Project
  • Discussion, Continued
  • Help for Individual Students, as needed

Due: Distribute Draft Computer-Science-Specific Report to Small Groups
May 1
More Signature Project
  • Additional Questions/Answers
  • Help for Individual Students, as needed

Due: Small Group Feedback on Draft Computer-Science-Specific Report

In-class Quiz #6
May 6
Time to Catch Up

Due: Computer-Science-Specific Report
May 8
Last day of class: Thursday, May 8

Due: Self-Reflection Paper (Final Version)
created 22 June 2021
developed and refined Summer 2021
revised Summer 2022
revised January 2023
revised Summer 2023
revised October 2024
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.