Introduction to the Course
Algorithms is an important as well as difficult topic that demands of its students a certain mathematical sophistication. I will try to provide additional resources in case that your class in Discrete Mathematics did not touch on certain topics, but these resources a no substitute for taking the full class.
To underline the importance of algorithms, I will be mining collections of programming interviews such as the book "Elements of Programming Interviews in Python" by Aziz, Lee, and Prakash for quiz and exam questions. You can use Python, C, or C++ to submit your code.
As Marquette students, you should have signed the honor's code. Violation of the honor's code will be dealt with in the humane way that the university committee on academic misconduct offers. If you collaborate with a person on homework, make a statement to this purpose. If you collaborate with a person on examinations or quizzes, you are violating the honor's code.
This class is intended to be an inverted class and I expect you to study the topic of the class before we meet. As we might have to move to a complete on-line format, you will have to attend zoom meetings at the scheduled class time. We will spend the class time deepening your understanding by lectures on particular difficult topics, activities, and quizzes. There is no make-up for missed quizzes.
The university has a policy of automatic drops for non-attendance, equivalent to two weeks of classes. This means that you will be dropped from the class, if you have not attended 6 class sessions. Your attendence is measured by your participation in the quizzes.
Homeworks are due on time. If your homework has mistakes, I might give you a chance to improve your answer.
Please monitor your grading, the interface of D2L makes it easy to loose freshly entered grades.
Syllabus
Here is the complete syllabus. --Click here.--
Office Hours
- Thomas Schwarz MTWF 1:30 pm - 2:30 or by appointment. (I am serious about the latter, just send me email.)
- I am going to host a zoom meeting with link https://us02web.zoom.us/j/81258461828?pwd=WElTYlJxRU8ybkhONyt6ZXlFOEZhUT09 and Passcode: 834069. Meeting ID: 812 5846 1828, Passcode: 834069
Piazza Discussion Board
piazza.com/marquette/spring2020/cosc3100
Week 1
Contents
Week 1
Homework
- Homework 1 -- Click here -- , due February 1, 2021 via D2L
Programming Assignment
- Programming Assignment 1 -- Click here -- , due February 1, 2021 via D2L via D2L
- Programming Assignment Presentation -- Click here --(mp4)
Module 0: Introduction
Monday, January 25, 2021
Materials
- Presentation (keynote) -- Click here --
- Presentation (ppt) -- Click here --
- Presentation (pdf) -- Click here --
- Models of computing (mp4 / 10 min) -- Click here --
- Evaluation of algorithms (mp4 / 8 min) -- Click here --
- Overview of class (mp4 / 2 min) -- Click here --
Module 1:
Contents: Finite State Machines and Regular Expressions.
Finite state machines and regular expressions are important software tools arising in a variety of settings. They are also important in theoretical computer science as for the definition of computability, the theory of languages, and the definition of Turing machines.
Learning Goals:
- Capability to describe and program finite state machines.
- Capability to use regular expressions to describe strings.
- Capability to convert between deterministic and non-deterministic finite state machines and regular expressions.
Materials
Quiz for January 31 (pdf), -- click here --
- Presentation (keynote) -- Click here --
- Presentation (ppt) -- Click here --
- Presentation (pdf) -- Click here --
- Class Jan 27, 2021 (mp4) -- Click here --
- Presentation (mp4, 7min) Transitions -- Click here --
- Presentation (mp4, 10min) Definition of Automata -- Click here --
- Presentation (mp4, 10min) Non-deterministic Finite Automata -- Click here --
- Worksheet (pdf) -- Click here --
- Regular Expressions Presentation (keynote) -- Click here --
- Regular Expressions Presentation (pdf) -- Click here --
- Regular Expressions Presentation (mp4) -- Click here --
- Regular Expressions Worksheet -- Click here --
- Regular Expressions to NFA (keynote) -- Click here --
- Regular Expressions to NFA (pdf) -- Click here --
- Regular Expressions to NFA (mp4) -- Click here --
- DFA to Regular Expression (keynote) -- Click here --
- DFA to Regular Expression (pdf) -- Click here --
- DFA to Regular Expression (mp4) -- Click here --
- Moody and Mealy machines (mp4) -- Click here --
Week 2
Programming Assignment
- Programming Assignment 2 -- Click here -- , due February 8, 2021 via D2L
- Programming Assignment Presentation (mp4) -- Click here --(mp4)
- Programming Assignment Presentation (pdf) -- Click here --(mp4)
- Homework 2 -- Click here --(mp4) , due February 8, 2021, via D2L
Module 2:
Contents: Computation Models and Landau Notation
Algorithms are evaluated traditionally in a very simple computation model, the RAM model. We discuss some of their inherent inaccuracies and why this model is still important. We also discuss the Landau notation about the growth of functions.
Learning Goals:
- Understanding of the RAM model and its limitations
- Capability to evaluate simple pseudo-code in the RAM Model
- Capability to compare the growth of analytic positive functions
Materials
- Reading: Sections 2.2 and 2.3 of "Introduction to Algorithms"
- Reading: Sections 3.1 and 3.2 of "Introduction to Algorithms"
- MIT class 1 click here
- MIT class 2 click here
February 3, 2021: Landau Notation
- The RAM model of computing (key) -- click here
- The RAM model of computing (pdf) -- click here
- The RAM model of computing (mp4) -- click here
- Growth of Functions and Landau Notation (key) -- click here --
- Growth of Functions and Landau Notation (pdf) -- click here --
- Growth of Functions and Landau Notation (mp4) -- click here --
- Class -- click here
Module 3:
February 5 2021: Correctness of Algorithms.
- Loop Invariants and the Euclidean Algorithm (key) click here
- Loop Invariants and the Euclidean Algorithm (pdf) click here
- Loop Invariants and the Euclidean Algorithm (mp4) click here
- A Mathematical View: Georgia Tech Open Resources: Induction and Euclidean Algorithm -- Click here --
- The correctness proof (MIT Open Courseware) -- Click here --
- Class video click here
Week 3
Assignments for Week 3
- Homework 3 -- Click here --
- Programming Assignment 3 -- Click here --
- Code from Programming Assignment 3 -- Click here
Module 4: Backtracking and Divide and Conquer
February 8, 2021: Backtracking and Divide and Conquer
- Presentation on Backtracking (keynote) -- Click here --
- Presentation on Backtracking (pdf) -- Click here --
- Presentation on Backtracking (mp4) -- Click here --
- Presentation on Divide and Conquer (keynote) -- Click here --
- Presentation on Divide and Conquer (pdf) -- Click here --
- Lecture Feb 8 -- click here --
February 10, 2021: Backtracking and Divide and Conquer
- Presentation on Divide and Conquer (keynote) -- Click here --
- Presentation on Divide and Conquer (pdf) -- Click here --
- Lecture Feb 10 -- click here --
February 12, 2021: Divide and Conquer and Recurrences
- Presentation on Recurrence (keynote) -- Click here --
- Presentation on Recurrence (pdf) -- Click here --
- Lecture Feb 12 -- click here --
- Presentation on Recurrence (keynote) -- Click here --
- Presentation on Recurrence (pdf) -- Click here --
- Presentation on Master Theorem (keynote) -- Click here --
- Presentation on Master Theorem (pdf) -- Click here --
- Lecture Feb 15 -- click here --
- Programming Assignment [click here]
- Homework [click here]
- Worksheet (pdf) -- Click here --
- Presentation (keynote) -- Click here --
- Presentation (ppt) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture Feb 17 -- click here --
- Presentation (keynote) -- Click here --
- Presentation (ppt) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture Feb 19 Click here
- Presentation (keynote) -- Click here --
- Presentation (ppt) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture Feb 22 Click here
- Programming Assignment click here
- Ordered List Python code click here
- Homework on Element Selection click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture Feb 24 Click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture Feb 26 Click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 1 Click here
- Presentation mp4 (click here)
- Presentation key (click here)
- Presentation pdf (click here)
- Solution key (click here)
- Solution pdf (click here)
- Homework [click here]
- Programming Assignment Assignment click here
- Programming Assignment Bloom Filter explanation (video)
- Programming Assignment Bloom Filter explanation (text)
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 3 Click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 5 Click here
- Presentation click here for mp4
- Presentation click here for pdf
- No Homework this week because of midterms
- Programming Assignment Assignment click here
- Programming Assignment Counting Statistics (video)
- Programming Assignment Counting Statistics (text)
- Programming Assignment Counting Statistics (code)
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 8 Click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 12 Click here
- Activities Click here for pdf
- Activities Click here for mp4
- Activities solutions Click here for mp4
- Presentation click here for pdf
- Presentation click here for mp4
- Sample Midterm click here for pdf
- Sample Midterm Solution click here for pdf
- Two more sample problems click here for pdf
- Dynamic and Greedy Programming click here for .key file
- Dynamic and Greedy Programming click here for .pdf file
- Dynamic and Greedy Programming click here for .mp4 file
- Homework hw7.pdf doubles as programming assignment
- Programming Assignment Football Scores: pa.pdf
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 15 Click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 17 Click here
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Lecture March 19 Click here
- Midterm Text. Please submit pdf in dropbox -- Click here --
- Midterm Solutions -- Click here --
- Presentation (keynote) -- Click here --
- Presentation (pdf) -- Click here --
- Explanation Click here
- Presentation keynote (click here)
- Presentation mp4 (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation mp4 (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation mp4 (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation mp4 (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation mp4 (click here)
- Presentation pdf (click here)
- Programming Assignment pdf (click here)
- Priority Queue Presentation pdf (click here)
- Priority Queue Presentation key (click here)
- Presentation keynote (click here)
- Presentation mp4 (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Programming Assignment pdf (click here)
- Programming Assignment pdf (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation keynote (click here)
- Presentation pdf (click here)
- Presentation mp4 (click here)
February 15, 2021: Solving Recurrences and the Master Theorem
Module 5: Sorting and Element Selection
Homework and Programming Assignment (due February 24, 2021)
February 17, 2020
Examples for recurrences and asymptotic behavior
February 17, 2021: On Sorting and Selecting: A review of permutations and sorting
February 19, 2021: On Sorting and Selecting continued: Selection problems
February 22, 2021: On Sorting and Selecting continued: Selection problems
Module 6: Advanced Data Structures: Skip Lists, B-trees, Linear Hashing
Homework due March 3
February 24, 2021: Skip Lists
February 26, 2021: B Treees
March 1, 2021: B Treees
B-Tree Activity
Homework due March 11
March 3, 2021: Linear Hashing
March 5, 2021: Linear Hashing
Help: Homework 5 : Maximum Sum Sub-Array using Divide and Conquer
Homework due March 19
Dynamic Programming Module
Dynamic programming is an optimization technique for a wide class of optimization problems. While often solutions are not NP, it is the go-to technique for difficult problems. Dynamic programming works by reducing a problem to the solution of similar problems, typically with a smaller instance size.
March 8, 2021
March 12, 2021
Midterm Preparation
Dynamic Programming Exercises
NFA with epsilon moves to NFA
Sample Midterm
Homework due March 26
Homework due April 5
March 15, 2021
March 17, 2021
March 19, 2021
Midterm
Practice Problem
Graph Algorithms
March 24
March 26
Graphs: Tours, Circuits, Representations
March 29
Graphs: Topological Sort
March 31, 2021
Graphs: Distance Algorithms
April 5, 2021
Graphs: BFS
Programming Assignment
due April 12, 2021
This programming assignment doubles as homework.
April 7, 2021
Graphs: DFS
April 9, 2021
Graphs: DFS Applications 1
April 12, 2021
Graphs: DFS Applications 2
April 14, 2021
Graphs: Minimum Weight Spanning Tree Algorithms
April 16, 2021
Graphs: Connected Components Example
April 19, 2021
Graphs: Prim's and Kruskal's Algorithm
April 21, 2021
Graphs: Ford-Fulkerson Algorithms
Programming Assignment
due April 26, 2021
This programming assignment doubles as homework.
Final Programming Assignment
due May 2, 2021
Sublinear String Matching
April 24, 2021
String Matching with Boyers Moore and variants
Repetition
April 26, 2021
Maximum Sub-Array
Repetition
April 28, 2021
Finite Automata for String Pattern Recognition / Computability
Computability
April 30, 2021
Computability
P vs NP
May 3, 2021
Definitions
May 7, 2021
Reductions