CSC148H: Lectures

Lecture Materials

Slides will be added here as .pdf files after each lecture.

Week Lecture Notes Lecture Files Readings / References
1 (May 15) Notes balanced.py
queue.py
stack.py
teststack.py
timestack.py
naivepq.py
1.3, 1.4 (optional), 2.1 - 2.4 (textbook)


First 2 pages of Computer Science and its Relation to Mathematics
(optional - accessible from on campus)
2 (May 22) Notes addressbook.py
contact.py
testaddressbook.py
catch1.py
catch2.py
exception1.py
exception2.py
reraise.py
userexception.py
userexception2.py
vars1.py
See URLs referenced in the Notes.
3 (May 29) Notes classbind.py
enclosing.py
namespaces.py
redefine.py
fact.py
fib.py
hanoi.py
sum.py
Dynamic Typing/Namespaces/Scopes

"Learning Python" by Mark Lutz 3rd edition
Chapter 6, pages 112-121; Chapter 16, pages 310-316

OR

"Learning Python" by Mark Lutz 2nd edition
Chapter 4.6, 13.1, 13.2, 13.3
(As a UofT student you have FREE electronic access to this edition of the book through the UofT library website. All you need is your UTOR id/password).

Python Scopes and Name Spaces

Naming and Binding
(This is from the python language reference and it's rather technical -- contains more than you really need to know.)

Namespaces Tutorial
Recursion

Chapter 3 of your textbook.
4 (June 5) Notes evalparsetree.py
evalparsetree2.py
listoflist.py
nodesrefs.py
traversal.py
traversal2.py
5.1 - 5.5 (textbook)
5 (June 12) Notes bst.py
5.6 (textbook)
6 (June 17) Notes bst.py
generator.py
iteration.py
iteration2.py
Iterators and Generators

Python Tutorial: Iterators and Generators


Algorithm Analysis

4.1 - 4.2 (textbook)


The following are slides on Big-Oh and Algorithm Analysis from a previous offering of the course. The slides include some examples in Java, but the syntax (for the given examples) isn't drastically different from Python. You may find these slide useful in addition to the material covered in your text and your lecture notes: 06bigoh.pdf
7 (June 26) Midterm Python style rules
8 (July 3) Notes sorts.py
search.py
Chapter 4.1
4.2
4.3.2 (binary search)
4.4
4.4.1 (bubble sort)
4.4.2 (selection sort)
4.4.3 (insertion sort)
4.4.5 (merge sort)
9 (July 10) Notes qsort.py
adjmatrix.py
adjlist.py
Chapter 4.4.6, 6.1-6.4.1
10 (July 17) see readings/references for material covered linked_list.py
node.py
sorted_list.py
test_lists.py
We discussed two separate ways for listing edges in a graph when using an adjacency list. I essentially reviewed the details from a post I had made on the bulletin board earlier in the week: post

We discussed BFS and why its time complexity is O(|V|+|E|). The argument is essentially the same as provided in this document. Note that the syntax of the algorithm is different from python, but the ideas are essentially the same. We did not cover the proof of correctness (lemma 1), so you don't have to worry about that part of the document.

Linked Lists - see chapter 7.1 of your text.
11 (July 24) see readings/references for material covered heap.py Heaps - Section 5.7 of textbook
12 (July 31) see readings/references for material covered heapsort.py example1.py We discussed how to build a heap from a list, and how to use this in conjunction with the percDown helper method to do an in-place heap sort. (See Section 5.7 of textbook. Note, however, that the algorithm presented in class differs slightly from your text.)

We discussed the correctness of the DFA construction algorithm given in Assignment #4. (This was "bonus" material that you do not need to know for the exam.)

We also started reviewing for the final with example questions.
13 (August 7) see readings/references for material covered We went through a number of practice questions for the exam.

Exam info has been posted here.