Skip to the content.

Detailed schedule

Class 24

Exam review. Whiteboard notes: whiteboard-12-9-2021.png

Class 23

Please fill out the official feedback form if you have not done so already.

Today’s topic: depth-first and breadth-first graph traversals.

PowerPoint: intuitive-graph-traversals.pptx

Handout: graph-traversals-handout.pdf

Handout solution: graph-traversals-handout-solution.pdf

Class 22

Please fill out the official feedback form for the course (we will do this in class time).

Today’s topic: graphs, including adjacency matrices and adjacency lists.

PowerPoint: class22-graphs.pptx

Class 21

Today’s topic: Java Stream API. We pick up where we left off last time with the filter() method. A slightly updated version of streamdemo.zip is available.

Class 20

Main topics for today: functional programming and lambda expressions. We may also begin on the Java Stream API.

Code: functionAsParam.py, FunctionParameterDemo.java, streamdemo.zip

To run Python code without installing anything, repl.it is a good option.

Purely for interest: If you are curious about where the “lambda” in lambda-expressions comes from… The use of the Greek letter lambda to represent an anonymous function was first introduced by Alonzo Church in his 1936 paper “An Unsolvable Problem of Elementary Number Theory”, American Journal of Mathematics, Vol. 58, No. 2. (Apr., 1936), pp. 345-363. This paper is one of two that are most closely linked with the birth of computer science as an academic discipline. The other is Alan Turing’s paper on computable numbers, also from 1936. To find out more, take COMP314.

Class 19

Hash tables, session II. We continue with the PowerPoint, Java files, and handout from last time.

As part of our discussion of a few computer scientists, it’s well worth checking out Joy Buolamwini’s poetofcode.com site, especially her video art “AI, Ain’t I A Woman.”

Class 18

Hash tables, session I.

PowerPoint: class18-hash-tables.pptx UPDATED on 11/18/2021 – fixed an error on slide 29

Java: HashCodes.java and ComputerScientist.java

Handout: hash-table-handout.pdf (and the handout solution UPDATED on 11/18/2021 – fixed errors)

Class 17b

Exam review session. Please bring any questions.

Also, we will go over stable sorting again, using an updated explanation.

As previously announced, homework assignment 6 will be graded on completeness only. Solutions are being made available today. Unlike most other homework assignments, you may consult the solutions when working on this assignment. To benefit as much as possible from the assignment, you should make a serious attempt at each question before consulting the solution.

Class 17

Note the announcement of midterm exam 2. Also note that homework six will be graded on completeness only, and can optionally be turned in before the exam or after the exam.

Topics:

PowerPoint: class17-heap-sort.pptx    UPDATED on 11/6/2021

Class 16

Sorting algorithms: Today we study insertion sort and merge sort. Next time we study heap sort. Note that the textbook also discusses selection sort and mentions bubble sort and quick sort. It is good to read about and be aware of selection sort and bubble sort but we do not study them in detail.

We’ve seen this before:

Powerpoint: class16-insertion-and-merge-sort.pptx

Class 15

Mid-semester feedback results:

Topics for today (all optional, not on the exam or homework):

  1. Generic expressions like CS232PriorityQueue<K extends Comparable<K>, V>
  2. AVL trees, or balanced trees generally.
  3. Javadoc demo
    • check out the Project | Generate Javadoc… command in Eclipse.
  4. Proof that height of complete tree is O(log n).
    • follows from the fact that 1 + 2 + 4 + 8 + 16 + … + 2^d = 2^(d+1) -1

Help and discussion of homework 5 (bring your own questions)

Class 14

Class 13

Class 12

Binary trees session 2. Today’s topics:

  1. Definitions of full and complete binary trees
  2. Statement of two theorems about binary trees
  3. Review traversals
    • Examine the code for level order traversal, which uses a queue rather than employing recursion.
  4. Review binary tree ADT, and compare with the Map ADT
  5. Overview of the Visitor design pattern (see sample code tree.PrintVisitor.java for an example). Additional examples of the Visitor pattern (very useful for the binary tree homework assignment):
  6. Homework help for the binary tree homework assignment

A useful example of how to add methods that assist in debugging your code: BTNode.java

Resources:

Class 11

Binary trees session 1. Today’s topics:

Resources:

For next time:

Exam review session

Class 10

Today’s topics:

  1. Iterators
  2. Example of amortized analysis: cost of adding to an ArrayList

Class 9

Today’s topics:

  1. Abstract data type (ADT)
  2. List ADT
  3. Array-based list implementation
  4. linked list implementation
  5. running times for list operations (array versus linked)
  6. stack ADT
  7. queue ADT

Except for stacks and queues, all of the above is review of COMP132. See Topic 12 of the COMP132 study guide.

Fill-in slide for running times of list operations (array versus linked).

Class 8

Review of how to use generics. Then the new idea for this course: how to create your own generic classes and methods.

Class 7

Review of algorithm analysis topic.

Class 6

Formal definition of big-O, big-omega, big-theta. Solving recurrence relations via expansion.

Class 5

Overview of asymptotic running times, especially big-O.

Class 4

Backtracking and its connection to recursion, via recursion trees.

Class 3

Some more sophisticated examples of recursion, including isReverse() from the textbook and the following two examples based on COMP232 sample code:

Class 2

Elementary examples of recursion, using the coding examples in the textbook.

Class 1

Overview of the course.

Review: install Eclipse, create and run a Java program.

Homework 0: pulling an assignment from GitHub and pushing your solution for grading.

Please fill out the GitHub username form.


Last modified: Mon Dec 06 16:28:58 UTC 2021 by jmac.