CS 415, Section 001 Sonoma State University Spring, 2024
 
Algorithm Analysis
Instructor: Henry M. Walker

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

Although much of this course has been well developed in recent semesters, the SSU CS faculty recently have approved a partially-updated course description. Currenly, the Web site is reasonably stable, but modest refinements are possbile.


Contract Negotiations Have Yielded a Tentative Agreement

Since May, 2024, the California Faculty Association (CFA) – the labor union of professors, lecturers, librarians, counselors, and coaches across the 23 California State University campuses – has been in negotiations with the management of the California State University System. After a one-day strike on Monday, January 22, the two sides have reached a tentative agreement, and the strike has been called off. Effective Tuesday, January 23, SSU classes (including CS 415) will be held as scheduled.

Tentative Class Schedule

Tuesday Thursday
January 23
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 25
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, February 1
January 30
Maintenance in the Software Life Cycle
Algorithmic Analysis via Experimentation
  • Simulations
  • Timing Algorithms

Reading
February 1
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 8
February 6
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 8
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 15
February 13
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 15
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 22
February 20
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 22 Readings:
More about Quicksort
  • Quicksort and Partition Procedure
!Assignment on Topological Sorting, Partition, and Quicksort
Due: Thursday, February 29
February 27
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
February 29
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

Divide-and-Conquer
  • Merge Sort

Readings:
In-class Quiz #3

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

Readings:
  • Levitin:
    • 6.4 Heaps
March 7
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


Assignment on Heaps, Sorting, and Using Algebra to Improve Efficiency
Due: Thursday, March 14
March 12
Time to Catch Up
March 14
Test 1

(March 14)
March 19
Spring Break (Tuesday, March 19)
March 21
Spring Break (Thursday, March 21)
March 26
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 28
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 4
April 2
Hashing
  • Efficiency Analysis for Hash Tables

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

Reading:
April 4
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 #4

Assignment on Consequences of Numeric Representation
Due: Thursday, April 11
April 9 Numerical Approximation Algorithms 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 11
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 18
April 16
Time to catch up
April 18
Test 2
April 23
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
April 25
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:

Assignment on Approximation Methods
Due: Thursday, May 2
April 30
RSA Encryption
  • Some Number Theory
  • Mechanics of RSA Encryption
  • Why RSA Encryption Works

Film:
In-class Quiz #5
May 2
More RSA Encryption
  • Some Number Theory
  • Mechanics of RSA Encryption
  • Why RSA Encryption Works

Assignment on RSA Encryption (with an Extra Credit Option)
Due: Thursday, May 9
However, if this assignment is submitted on Tuesday, May 7, it will be graded and returned on Thursday, May 9.
May 7
Time to Catch Up

In-class Quiz #6
May 9
Last day of class: Thursday, May 9
May 14
Exam: Tuesday, May 14: 1:00-3:00
May 16  
created 22 June 2021
developed and refined Summer 2021
revised Summer 2022
revised January 2023
revised Summer 2023
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.