Lectures

Lecture schedule: please attend the lecture time for which you are enrolled.

Before each lecture, check this table to find out your assignments that need to be completed before the lecture. It's typically three things:

At the end of each lecture, please take a minute to submit feedback here:

Lecture feedback web app

We are looking for feedback on how productive your lecture was. Was the content useful? Were your interactions with a peer constructive? Also, any topics you feel particularly comfortable with, uncomfortable with?

Your keys to achieving maximum lecture participation points:

Attend and participate in lectures:
a) attend the section you are officially enrolled in (you are allowed 5 missed sections before it starts to impact your grade)
b) work with a different partner each class period
c) log your lecture feedback in the web app at the end of each lecture
i) net ID “A” works with net ID “B” AND net ID “B” works with net ID “A"
ii) (it is fine to work with a group of three people in a lecture if that works better logistically - just make sure to two sets of interactions: For example, A works with B; B works with A; AND B works with C; C works with B;

The goal: to give equal ratings of 1s 2s 3s ... 9s and 10s throughout the duration of the course.


Spring 2017 Lectures & Demos.

Weekly Activities

We will continue to update this page throughout the semester. Expect future lectures and pre-lecture activities to change slightly as the course progresses.

  #  Pre-lecture ActivitiesBits and Bytes
Digital Computing Architecture
Assignments (MPs, Turing's Craft)
Week of: January 16, 2017
1
Wednesday, January 18, 2017

No prep

What is CS125? How it is organized?
  • Register in Piazza.
  • Bring your laptop to lab/discussion session this week and next to install java, eclipse and svn.
  • Set up Turing's Craft using Code Lab Setup
  • If you want to take proficiency exam, make a request.
  • Come to all classes prepared, doing the pre-lecture activities ahead of time.
  • Note that lectures will often begin with questions from the readings.
2
Friday, January 20, 2017

Simple data modeling
Week of: January 23, 2017
3
Monday, January 23, 2017

Von Neumann Architecture
#Pre-lecture ActivitiesProcedural Programming
How to write small but useful programs
Assignments (MPs, Turing's Craft)
4
Wednesday, January 25, 2017

Program elements:
  • algorithm
  • composition
  • Java virtual machine
  • variables and types
  • control structures
  • primitives
  • subroutines
5
Friday, January 27, 2017

  • Architecture and Algorithm Development
  • Developing a program is a four-step cycle:
    1. edit (write a new program or change an existing program)
    2. compile (encode program in bit string form)
    3. run program through tests to see how well it works
    4. debug to find errors and deduce their cause
Week of: January 30, 2017
6
Monday, January 30, 2017

  • Starting java programming...
  • Variables, Types, Operators, Expressions, Statements, Variable declaration and assignment.
Homework #0 due in lab-discussion section next week

7
Wednesday, February 1, 2017

Type checking and I/O
Type checking examples: String Object
Understand:
  • memory allocation
  • reference variable
  • dot operator
  • difference between instantiation and creation
    (which requires allocation) of an object
  • distinction between a class (description)
    and object, the allocation
String instance methods to be illustrated:
  • s1.equals(s2)
  • s1.equalsIgnoreCase(s2)
  • s1.length()
  • s1.charAt(N)
  • s1.substring(N, M)
  • s1.indexOf(s2)
  • s1.compareTo(s2)
  • s1.toUpperCase()
  • s1.trim()
  • +
Input and output I/O:
  • TextIO
  • System.out.println
Enumerator / Enumerator constants enum enum-type-name { list-of-enum-values }
8
Friday, February 3, 2017

  • String functions
  • Passwords, Facebook and Google - Powered by Strings
Week of: February 6, 2017
9
Monday, February 6, 2017

  • TC exercises 2.5
  • Jason 5 - Boolean Expressions, Simple Conditionals, and Statements
  • ch2.5 Operators, expressions and casting
  • Expressions, conditionals, and statements
  • Boolean expressions: != ==
  • Logical operators
  • Relational operators:
    • Short circuiting
    • Using relational and logical operators together
    • Conditional introduced and statement redefined
MP 1 is due next Monday at 8PM.

MP 2 is out.

10
Wednesday, February 8, 2017

  • TC exercises 3.1 and 3.5
  • Jason 6 - Compound Statements, Scope, and Advanced
  • Conditionals
  • ch3.1 Compound Statements, Simple Loops
  • ch3.5 If revisited
  • Conditionals
  • Compound statements
  • Conditionals with compound statements
  • Scope:
    • Examples of scope in conditionals
    • If-else statement
    • The dangling if-else problem
A 13-minute video showing the Eclipse, Subversion, checkout, commit, workflow for CS 125 MPs
11
Friday, February 10, 2017

  • TC exercises 3.3 and 3.4
  • Jason 7- Loops
  • ch3.3 Looping: do while (break and continue statements are not going to be used in this course)
  • Loops: repeating code statements many times:
    • "While" loop:
      • single statement
      • compound statement
      • do while
      • common errors
    • "For" loop
  • The dangling if-else problem
  • Examples of loops in action
A 13-minute video showing the Eclipse, Subversion, checkout, commit, workflow for CS 125 MPs
Week of: February 13, 2017
12
Monday, February 13, 2017

  • TC exercises 3.3 and 3.4
  • Jason 7- Loops
  • ch3.4 For loops and Nested Loops
  • Loops
  • The dangling if-else problem
  • Examples of loops in action
MP 1 is due at 8PM. MP 2 is due next Monday 8PM.
13
Wednesday, February 15, 2017

  • TC exercises 7.1
  • Jason 8 - One-Dimensional Arrays
  • ch7.1 Creating and Using Arrays
  • Assign value to a particular cell: arr[3] = 25;
  • Read a value from a particular cell: TextIO.putln(arr[0]);
  • Change a value in a particular cell; arr[3] = foo(someInt);
  • Single-dimension arrays
  • Motivation - the need for arrays
  • Terminology - define array,cells,Index/subscript
  • Memory allocation with the new operator
  • Requires a ref variable int[] arr;
  • Allocates dynamic memory for the array in heap
  • Syntax: int[] arr = new int[someSize]; The [expr] "bracket" operator expects an integer expression; 0 based array structure
  • Syntax: collection of a single type, the length property, common errors
14
Friday, February 17, 2017

  • TC exercises 7.2
  • Jason 10 - Processing Data Collections
  • ch7.2 Processing Data Collections.
  • Specifically:
    • 7.2.1) Arrays and for Loops: System.arraycopy()
    • 7.2.5 Arrays of Objects.
    • 7.2.6 Variable Arity Methods: The arity of a subroutine is the number of parameters
  • Processing Data Collections
  • Motivation - the need for processing collections of data
  • Figure out what we want to do for each cell.
  • Common Error: ArrayIndexOutOfBoundsException
  • Terminology: Parallel arrays: The data for a given copy of the message is spread out across several arrays.
Week of: February 20, 2017
15
Monday, February 20, 2017

  • TC exercises 7.5 (If they exist)
  • Jason 9 - Multi-Dimensional Arrays
  • Multi-dimensional arrays
  • Motivation - the need for multi-dimensional arrays
  • Define multi-dimensional array
  • Usage - show the multi-dimensional array
  • Syntax: type [][] varname = new Type[sizeOfFirstDimension][sizeOfSecondDimension];
  • still a collection of a single type
  • how does the length variable work?
  • Rectangular arrays: what does theMatrix.length return? What does theMatrix.length[0] return?
  • common errors
MP 2 is due 8PM this evening.
16
Wednesday, February 22, 2017

  • ch3.8 Partially-full arrays
  • ch7.5 Two-Dimensional Arrays
  • make a 1D array bigger than you need to store information. Keep track of the number of "good" data values with an integer index representing the number of "good" data values
  • draw out a 2D array (left first) and show how the user's conceptualization can be different whereby the use of the []
  • operators may symbolize [col][row] or [row][col], depending on user preference and more importantly, consistency of use.
  • #Pre-lecture ActivitiesMethods and Classes
    How to write larger Object Orientated Programs
    Assignments (MPs, Turing's Craft)
    17
    Friday, February 24, 2017

    • TC exercises 4.1
    • Jason 11 - Procedural Composition and Abstraction
    • ch4.1 Procedural Composition
    • Procedural Composition and Abstraction
    • Motivation - solving a problem with help
    • Define: Procedural abstraction - Hide away the implementation details. Encapsulation.
    • Example: Graphics
    Week of: February 27, 2017
    18
    Monday, February 27, 2017:
     if (iyear%4==0) leapYear=true

    Static methods (class methods) and variables (class variables)
    Define:
    • function or subroutine
    • Parameters
    • Arguments
    • Return statement
    • "void" in place of a return type
    • "public static"
    • Syntax:
      • Method signature: return-type method-name(t1 p1,...,tn pn);Name;Return type;Zero or more parameters;
      • How the compiler does checks when a method is called;
      • Method definition - code for a method since it defines what the method does;
      • Method call - calling a method: method-name(argument1,...,argument n);
      • Scope in methods, Parameter variables, Local variables
      • How the compiler does type checking
      • Using methods from other classes; className.methodName(arg1,...,argN); the dot operator
      • Visual example of method calls (note cards)
    19
    Wednesday, March 1, 2017

    • ch4.2 Static Subroutines and Static Variables
    • ch4.3 Parameters (omit 4.35, 4.36)
    • ch4.4 Return Values
    • There are four things that every variable has: name, type, location in memory, value.
    lesson 18 continued
    20
    Friday, March 3, 2017

    • TC exercises 4.7
    • More about Methods
    • ch4.6 Pre and Post-conditions. Bottom up Design
    • ch4.7 Initialization and scope
    • Methods (these are static from previous 2 lectures)
    • Motivation
    • Define:
      • Global variables
      • Overloading
      • Formal parameters or dummy parameters
      • Actual parameters or arguments
    • Throwing exceptions: IllegalArgumentExceptions, NumberFormatException.
    Week of: March 6, 2017
    21
    Monday, March 6, 2017

    • TC exercises 5.1
    • Jason 13 - Reference Variables and Objects
    • Jason 14 - Objects and Methods
    • ch5.1 Objects, Instance Methods, and Instance Variables
    • Objects and reference variables
    • Convert a parallel arrays and non-modular program written in main (one method) into an objected oriented model.
    • Motivation - abstraction/encapsulation, organization, ease of use, code reuse, conceptualization. Design and building generalized software components
    • Define: memory allocation and the new operator; Dynamic (heap) memory versus stack (local) memory; 3 types of data storage in Java {primitive type variables, reference variables, object state }
    • Know the difference between a class and an object.
      • Recall from 5.1 in the reading that an object that belongs to a class is said to be an instance of that class.
      • The variables that the object contains are called instance variables.
      • The subroutines that the object contains are called instance methods.
      • If you do not allocate using "new," you have no object, and therefore no instance to use.
      • You need create to allocate, and instantiation represents only the first step (the intention) to allocate an object.
    • Usage & syntax:
      • int [] scores; // declare reference variable scores (initializes to null)
      • scores = new int[Size]; // allocate the space for the object;
    • What is a null pointer exception? Are all reference variables automatically initialized to null?
    • Integration of topics:
      • Method overloading
      • Private and public access member specifiers
      • Getter and Setter methods - defines a property
    22
    Wednesday, March 8, 2017

  • ch5.1 Objects, Instance Methods, and Instance Variables
  • Previous topics continued
    23
    Friday, March 10, 2017

    • TC exercises 5.2
    • Jason 18 - static versus non-static, and Constructors
    • ch5.2 Constructors and Object Initialization
    • Deadline to drop a UG semester course without grade of W
    • Two kinds of methods: instance method, class method
    • Four kinds of variables and when to use them: local variable, parameter variable, instance, class variable
    Week of: March 13, 2017
    24
    Monday, March 13, 2017

    • Understand these terms:
    • Java features:
      • Built in classes (5.3.1)
      • The class "Object"
      • Hash code
      • The toString() method
    • Subclasses (more in 5.5 when we talk about inheritance)
    25
    Wednesday, March 15, 2017

    • TC exercises 5.4
    • ch5.3 continued
    Lesson 23 continued
    26
    Friday, March 17, 2017

    • TC exercises 5.5
    • ch5.5 Inheritance, Polymorphism, and Abstract Classes
    • ch5.6 this and super
    Inheritance in Java
    * * * * * Week of: March 20, 2017 - Spring Break * * * * *
    Week of: March 27, 2017
    27
    Monday, March 27, 2017

    ch8.2 Writing correct programs

     
    28
    Wednesday, March 29, 2017

    ch8.3 Exceptions and try..catch

     
    #Pre-lecture ActivitiesRecursion
    How to write recursive programs
    Assignments (MPs, Turing's Craft)
    29
    Friday, March 31, 2017

    Chortle 71 (alternate)

    Programming in the large, software engineering
    Week of: April 3, 2017
    30
    Monday, April 3, 2017

    Chortle 72 (alternate)

    Recursion on linked lists
    31
    Wednesday, April 5, 2017

    Chortle 72 (alternate)

    Activation Diagrams
    32
    Friday, April 7, 2017

    Chortle73 (alternate), Jason 24

    Recursive counting
    Week of: April 10, 2017
    33
    Monday, April 10, 2017

    ch9.1.1, Jason 26

    Recursive searching
    34
    Wednesday, April 12, 2017

    Jason 27

    Recursive sorting
    #Pre-lecture ActivitiesAlgorithm Analysis
    A quick study of sorts
    Assignments (MPs, Turing's Craft)
    35
    Friday, April 14, 2017

    Jason 27

    Lecture Video

    Selection Sort Video

    Binary search, Recursive sorting
    Week of: April 17, 2017
    36
    Monday, April 17, 2017

    Jason 31, 32

    Merge sort, Desktop applications
    37
    Wednesday, April 19, 2017

    Jason 31, 32

    Insertion sort, recursion review
    38
    Friday, April 21, 2017

    Jason 33

    Recursive variety and puzzles
    * * * * * Week of: November 21, 2017 - Thanksgiving Vacation * * * * *
    Week of: April 24, 2017
    39
    Monday, April 24 2017

    Jason 33

    Analysis of iterative methods 
    40
    Wednesday, April 26, 2017

    Jason 35

    • Analysis of recursive methods
    • iOS programming
    41
    Friday, April 28, 2017

    • Model-View-Controller
    • iOS programming
    • Why Mergesort is always O(N Lg N) with O(N)
    Week of: May 1, 2017
    42
    Monday, May 1, 2017

    Jason 40

    • Quicksort
    • Algorithm Analysis
    43
    Wednesday, May 3, 2017

    Advice

    • Why Quicksort is usually O(N Lg N) and requires no additional space
    • Final Exam Practice
    May 5-12, 2017 - Final Exams
    Exact date/time of our final exam will be announced in early April