CSC148, Winter 2014

Welcome to CSC148, Introduction to Computer Science. In this course you will think scientifically about program design concepts such as modularity, encapsulation, and information hiding, about powerful programming techniques such as recursion and linked structures, and criteria for comparing programs such as efficiency.

This page is for St. George Campus.There are related pages for CSC148 at UTM and CSCA48 at UTSC

Extra help: Every Monday through Thursday, 4–6 p.m., the CSC Help Centre awaits your questions.

Below you'll find a calendar with entries for all significant course events

Week:MondayTuesdayWednesdayThursdayFriday
Week #1
Reading:
  1. Week 1 slides
  2. Object-oriented python
  3. PEP8, official Python style guide
  4. PEP275, python documentation style guide
  5. PEP3107, python function (type) annotations
Python examples:
Jan 6
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Jan 7Jan 8
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
    recursion preview (dustin's section)
Jan 9Jan 10
Week #2
Reading:
  1. slides on ADTs, python style
  2. Code like a pythonista
  3. Article on Python properties
  4. Stacks
  5. lab #1 handout
  6. Lab sections by time and surnames
Python examples:
  1. using property to control access to coord attribute
  2. stack example from lecture
  3. another stack implementation
  4. a stack tester
  5. recursive example: sum a nested list
Jan 13
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Jan 14
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Jan 15
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides (updated Jan16)
  3. example code (updated Jan16)
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Jan 16
  1. Exercise #1 handout
  2. submit Exercise 1 by 9:59 p.m.
Jan 17
Week #3
Reading:
  1. lecture slides
  2. Lab #2 handout
  3. Python tutorial on inheritance
  4. Inheritance versus composition
  5. Exceptions
Python examples:
  1. Stack superclass (base class)
  2. IntStack subclass (derived class)
  3. raising and catching exceptions
Jan 20
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Jan 21
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Jan 22
  • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  • Lecture, 6:10–8:00 p.m., MS3153

files updated 23 Jan

  1. slides
  2. exceptions.py
  3. stack.py
  4. int_stack.py
  5. mult_inher.py
  6. ordered_set.py
  7. simulating_recursion.txt
  8. new_point.py
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Jan 23
  1. slog handout
  2. submit slogURL.txt by 9:59 p.m.
Jan 24
Week #4
Reading:
  1. lecture slides
  2. Recursion notes. But use list comprehensions and built-ins for shorter, clearer code of your own.
  3. handout for lab #3
  4. How to choose test cases (from CSC108)
  5. Testing functions that mutate values
Python examples:
  1. more nested list recursion
  2. some turtle recursion
  3. permutations using recursion
Jan 27
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Jan 28
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Jan 29
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides
  3. recursion ex remove3s
  4. recursion ex Sierpinski
  5. recursion ex permutations
  6. recursion ex turtle
  7. functional programming w/ nested lists
  8. recursion ex binary codes
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Jan 30
  1. Exercise #2 handout
  2. submit Exercise 2 by 9:59 p.m.
Jan 31
Week #5
Reading:
  1. lecture slides
  2. lab #4 handout
Examples:
  1. code for tower of hanoi recursion
  2. example of find names in different scopes
Feb 3
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Feb 4
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Feb 5
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides
  3. towers of hanoi (updated 6 Feb)
  4. namespaces/scopes
  5. unit testing exercise
  6. soln to switches from lab (updated 6 Feb)
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Feb 6Feb 7
Week #6
Reading:
  1. slides
  2. How to think like a computer scientist --- trees
  3. lab #5 handout
Examples:
  1. binary trees as python lists
  2. linked implementation of a tree
Feb 10
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Feb 11
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Feb 12
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides
  3. tree traversals on nested lists
  4. recursive tree class (*UPDATED Feb 21*)
  5. recursive linked list class
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Feb 13
  1. Handout for Assignment #1
  2. submit Assignment 1 by 9:59
Feb 14
Reading week!
Week #7
Reading:
  1. lecture slides
  2. linked list reading
  3. lab #6 handout
Examples:
  1. linked list example
Feb 24
  1. annotated slides
Feb 25
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Feb 26
    • Test, 9:10–10:00 or 10:10–11:00
  1. fall 2013, first term test
  2. winter 2013 first term test
  3. old midterm that covers more material (e.g. big-Oh)
  4. Test solutions:
    • Test, 6:10–7:00
    • Lab, 11:10–1:00, BA3175–BA3195
    • Lab, 1:10–3:00, BA3175–BA3195
    • Lab, 3:10–5:00, BA3175–BA3195
    • Lab, 5:10–7:00, BA3175–BA3195
Feb 27Feb 28
Week #8
Reading:
  1. lecture slides
  2. two ways to represent linked lists
  3. handout for lab #7
Examples
  1. linked list with wrapper example
Mar 3
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
Mar 4
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Mar 5
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides
  3. LinkedList with two versions of initializer
  4. linked list with LLNode class + wrapper class
  5. binary search trees
  6. linked list implementation of Stack ADT
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Mar 6
  1. Assignment #2 handout
  2. submit Assignment 2 part I, by 9:59 p.m.
Mar 7
Week #9
Reading:
  1. lecture slides
  2. Wikipedia binary search trees --- only the material on definition and operations
  3. lab #8 handout
Examples:
  1. binary search tree example
Mar 10
    • Lab, 9:10–11:00, BA3175–BA3195
  1. annotated slides
Mar 11
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Mar 12
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides (updated Mar 13)
  3. almost-sorted search problem
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Mar 13
  1. Exercise #3 handout
  2. submit Exercise 3 by 9:59 p.m.
Mar 14
Week #10
Reading:
  1. lecture slides
  2. Sorting, in Interactive Python
  3. Timsort, the algorithm used by python's built-in sort
  4. lab #9 handout
Python examples
  1. sort.py examples
Mar 17
  1. annotated slides
Mar 18
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Mar 19
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
  1. annotated slides
    • Lecture, 6:10–8:00 p.m., MS3153
  2. slides
  3. sorting functions
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Mar 20
  1. ./Assignments/A2/a2.pdfAssignment #2 handout
  2. submit Assignment 2 part II by 9:59 p.m.
Mar 21
Week #11
Reading
  1. lab #10 handout
  2. lecture slides
Mar 24
  1. annotated slides
Mar 25
  • Lab, 9:10–11:00, BA3175–BA3195
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 7:10–9:00, BA3175–BA3195
Mar 26
    • Test, 9:10–10:00 or 10:10–11:00
  1. sample second term test
  2. test a solutions
  3. test b solutions
  4. test c solutions
  5. test d solutions
  6. test e solutions
  7. solutions common to all versions
  8. BST_rec1.py lab solution
  9. BST_rec2.py lab solution
  10. BST_rec3.py lab solution
  11. BST_iter.py lab solution
  12. inorder.py lab solution
  13. longest.py lab solution
  14. linked_list.py lab solution
  15. lab07_linked_list.py lab solution
    • Test, 6:10–7:00
  16. Lecture, 7:00–8:00 p.m., MS3153
  17. slides
  18. fibonacci.py (memoization)
  19. practice prob for final [hint, solution]
  20. sort.py with timing bug fixed
  • Lab, 11:10–1:00, BA3175–BA3195
  • Lab, 1:10–3:00, BA3175–BA3195
  • Lab, 3:10–5:00, BA3175–BA3195
  • Lab, 5:10–7:00, BA3175–BA3195
Mar 27Mar 28
Week #12
Reading:
  1. lecture slides
  2. exam first page
Examples:
    Mar 31
    • Lecture, 9:10–10:00, or 10:10–11:00, WB116
    Apr 1Apr 2
      • Lecture, 9:10–10:00, or 10:10–11:00, WB116
    1. annotated slides
      • Lecture, 6:10–8:00 p.m., MS3153
    1. slides
    2. polygon class
    3. special polygon class
    4. int to decimal string example problem
    Apr 3
    1. Exercise 4 handout
    2. submit Exercise 4 by 9:59 p.m.
    Apr 4