Announcements, Homework, Lecture Outlines

Wednesday 9-July

Announcements

All projects due by 5:00 pm Friday, 11-June
Rick will be in the lab (930GS) 
Today until 6:00 pm (or later)
Friday 1:00-2:30
Friday 4:00-5:00
Optional Random Writer with HashMap considered extra credit to replace your lowest lab score.  This will be due Thursday 4:00pm Friday 5:00pm
Either have your final project live graded or turn it in to WebCat under DiceTray stringFound 
The score will not be accurate, but I will download and grade it
Final grades posted HERE .  You need your CSID from this link https://www.cs.arizona.edu/computing/services/csid.html
And if you want a Boggle GUI, use the final project spec and BoggleGUI.java

Homework

None

Lecture Outline

Quiz
Go to lab

 

Wednesday 9-July

Announcements

New: Boggle Specs now include the Design of DiceTray and Boggle for Iteration 2
doc or pdf
Final Project posted: Part 1 due tonight, part 2 Thursday night
DiceTray stringFound(String) is now WebCatted
Optional Random Writer with HashMap now considered extra credit to replace your lowest lab score.  This will be due Thursday 4:00pm
Quiz 5: Binary tree traversals, recognize BSTs, add two methods to OrderedMap<K, V>
Thursday is the last day of class: Take quiz then go to lab immediately to work on Boggle

Homework

Work on Boggle: DiceTray with DiceTray(char[][]) and boolean stringFound() due tonight at 10:00pm
Take this practice quiz doc or pdf

Lecture Outline

Final Project 
Boggle 1: Dicetray DiceTray with DiceTray(char[][]) and boolean stringFound() 
Boggle 2: Design the system.

Lab in 930GS

Work on Final Project

 

Tuesday 8-July

Announcements

NEW After class: Final Project posted if you wish to get started doc or pdf
DiceTray stringFound(String) will not be WebCatted until 1:00pm Wednesday
NEW After class: Random Writer with HashMap now considered extra credit to replace your lowest lab score.  This will be due Thursday 4:00pm

Homework

Work on Project 7: Game of 20 Questions, due tonight @ 10:00pm

Lecture Outline

OrderedMap remove (algorithm only, no code) 
Code Demo, add these three methods
boolean containsKey(K key)
OrderedMap<K, V> subMap(K fromKey, K throughKey)
int nodesAtLevel(int level)
Introduce some of Java's Collection framework
Break
Introduce an algorithm for Random writing by Joe Zachary
Demo with ArrayList: slow  
Demo with HashMap: fast   
Discuss algorithm with HashMap

Lab in 930GS

RandomWriter with HashMap

Monday 7-July

Announcements

Remaining after today
3 days of lecture / lab
1 quiz
final project: assigned Tuesday, due Thursday

Homework

If you haven't already done so, read Chapter 11: BinaryTrees
Complete Project 7: Game of 20 Questions by 10:00pm Tuesday

Lecture Outline

Add two more methods to ExpressionTree 
sideways() return the tree data as a string in a sideways fashion
saveToFile(String fileName)  write the expression tree to a file in preorder fashion 
ExpressionTree and ExpressionTreeTest will be used in today's lab
add method int valueOf()  to return the value of the expression tree
2-OrderedMap.ppt using a Binary Search Tree (BST)
Code Demo: implement the put and get methods
Discuss and Demo Project 6: GameOf20

Lab in 930GS

Expression Tree:  see labs page
If time permits, work on Project 7: Game of 20 Questions

Thursday 3-July

Announcements

Remaining after today
4 days of lecture / lab
1 quiz
1 project (introduced today)
final project

Homework

None over the weekend
For Tuesday
Read Chapter 11: BinaryTrees
Complete Project 7: Game of 20 Questions by 10:00pm 

Lecture Outline

Quiz
Introduce 11-BinaryTrees.ppt  11-1..11-18
Code Demo: Begin Expression Tree
Discuss Project 7: Game of 20 Questions
Due Tuesday, 8-July 10:00pm

Lab in 930GS

Cancelled Expression Tree:  see labs page

 

Wednesday 2-July

Announcements

Quiz Thursday: Recursion.

Homework

Complete RecursionFun
Take Practice Quiz   pdf

Lecture Outline

Recursion in two problem-solving strategies
Divide and Conquer: QuickSort  MoreRecursion.ppt   10B-14.. 10B-46
Demo O(n2) with O(n log n) sorting algorithms with CompareSorts,java
Will likely need this VM argument -XX:+AggressiveHeap
Backtracking: Escape the maze, algorithm in Obstacle Course

Lab in 930GS

Using the algorithm in Obstacle Course, complete two methods (possible and findExit), see lab page
If time permits, work on RecursionFun

 

Tuesday 1-July

Announcements

Project 6: "RecursionFun" due Wednesday night

Homework

Read to the end of Chapter 10: Recursion
Work on Project 6 

Lecture Outline

Code demo: Palindrome
Code demo: Recursion with arrays

public static int sumArray(int[] x, int firstIndex, int lastIndex)  
public
static int sequentialSearch(String[] a, String search)
  Return the index of search or -1 if not found
public
static int
range(int[] x)

More Recursion MoreRecursion.ppt   10B-1 .. 10B-14
Code demo printNumberInBase
In class: Four Recursion Problems

Lab in 930GS

Complete these three from http://javabat.com/java/Recur1
 array11  array220  allStar
Work on project 6: RecursionFun 

 

Monday 30-June

Announcements

Project 5: LinkedPriorityList due tonight
Project 6 Linked: RecursionFun due Wednesday night

Homework

Begin Project 6 up to but not including commas(long): RecursionFun (see projects page

Lecture Outline

Begin 10-SimpleRecursion.ppt 
Consider Project 6: RecursionFun
Try one or two http://javabat.com/java/Recur1
In class: Four Recursion Problems

Lab in 930GS

Complete Lab8.html  Expression.valueOf(String)
From the top five rows (ints and strings, no arrays yet). complete as many of these as you can http://javabat.com/java/Recur1
3 pts If you stay to 4:00 and finish are least three

Thursday 26-June

Announcements

Too many projects? Project 6 will be a lab to finish today
Only Project 5: LinkedPriorityList is due next Monday at 10:00 pm

Homework

Work on Project 5
Read pages  170-184 in Chapter 10: "Recursion"
Answer all self-checks, answers are linked from Ricks Book

Lecture Outline

Quiz Review
Questions Asked in retrospective
Answers to practice Quiz 3 Answer  doc or pdf
Quiz
Break, meet back at Time TBA
Introduce Stacks, 10-1 .. 10-16
Code demo: BalancedSymbolChecker.java
Another Stack Application
Evaluate postfix expressions in Stacks, 10-7 .. 10-21

Lab in 930GS

None 

 

Wednesday 25-June

Announcements

NEW Practice Quiz 3 Answer  doc or pdf
Project 5: LInkedPriortyList<E> is linked and WebCatted (see Projects page
It is due Monday, 30-June @ 10:00 pm.
Tomorrows Quiz Thursday on Collection Considerations and the Singly Linked Structure
Practice quiz handed out today to show the scope  doc or pdf

Homework

If necessary, submit  ArraySet<E> to WebCat before Thursday's quiz
Complete Lab LinkedSet<E> implements Set<E> and submit to WebCat before Thursday's quiz
Work on Project 5: "LinkedPriorityList", due Monday @ 10:00 pm.
Project 6 (assigned Thursday) will also be due Monday at 10:00pm
Take this practice quiz: doc  or pdf
Complete all self-checks in Chapters 6 and 8 (answers on web page)
Read Chapter 9: Stacks and Queues

Lecture Outline

More Algorithms with a new Linked Structure: OrderedList
addInOrder(E)
get(int)
toString as in [Abc, Def, Ghi, Jkl]
Introduce Project 5: LinkedPriorityList<E> implements PriorityList<E>
Ask 127A Strudents using Java Illuminated if a 127A book like our 227 would be good or bad
Rick is teaching 127A this fall and has to make a book decision by Tomorrow.
Complete in class: 1) Write a test for OrderedList remove(E) and the remove(E) method 
We're half way done, please complete Mid Way Retrospectiveand go to the lab.

Lab in 930GS

Complete LinkedSet<E> implements Set<E>   see Labs Page
If time permits, work on Project 5,  
Either email the source code or remember you can transfer these files to and your home computer with WinSCP

Tuesday 24-June

Announcements

Project 4 extended to tonight: Tuesday, 24-June 10:00 pm.
PriorityListGUI.java has been updated to NOT have Iterator<E>
Now you can optionally use this class to see a GUI for your well tested model named ArrayPriorityList
Quiz Thursday on Collection Considerations and the Singly Linked Structure
Practice quiz handed out today to show the scope  doc or pdf
To transfer files between home and your "H" drive of your CS account, try WinSCP

Homework

If necessary, submit  ArraySet<E> to WebCat (a lab from two days worth 3 pts)
Work on Project 5, due Monday @ 5:00 pm.

Lecture Outline

Slides 28..34 of 06-CollectionConsiderations.ppt   (5 minutes)
Introduce Linked Structures with 08LinkedIntro.ppt (25 minutes)
Code demo (and a preview of today's lab activity)  (25 minutes)
Refactor Rename ObjectCollection to ArrayCollection
Create an interface for the methods in ObjectCollection 
Have ArrayCollection implement the interface, make sure all tests still pass
Create a new unit test and class for LinkedCollection
Find/Replace all occurrences of ArrayCollection with LinkedCollection
Complete LinkedCollection
Complete in class and go to lab

Lab in 930GS

Complete LinkedSet<E> implements Set<E>
see Labs Page

 

 

Monday 23-June

Announcements

NEW Project 4 extended to Tuesday Night 10:00 pm.
NEW PriorityListGUI.java has been updated to NOT have Iterator<E>
Optionally use this class to see a GUI for your well tested model named ArrayPriorityList

Homework

Read Chapter 8 

Lecture Outline

Another interface Iterator: Add an iterator to GenericCollection
Use an inner class to simplify the Iterator and keep it together with the Collection class
Make ObjectCollection Iterable so you can use then enhanced for loop
While there, make sure GenericCollection can only store instances of Comparable
better to err at compiletime (type not Comparable) rather than at runtime (class cast exception)
Consider the interfaces in java.util
http://java.sun.com/docs/books/tutorial/collections/interfaces/index.html
Preview today's lab

Lab in 930GS

Make Set<E> extend Iterable<E> and add 3 new methods to the ADT
see Labs Page

 

Thursday 19-June

Announcements

Project 4 posted  see Projects Page

Homework

Read all of Chapter 6, all pages
Read the first 11 pages of Chapter 7: The list ADT, (online pages 110..120)
Work on Project 4 ArrayPriorityList<E> implements PriorityList<E>, Due next Monday @ 10:00pm

Lecture Outline

Slides 11..50 of 06-CollectionConsiderations.ppt  
Convert ObjectCollection to have Generics

Lab in 930GS

Given a unit test and an interface, write a generic set class  see Labs Page

 

 

Wednesday 18-June

Announcements

Quiz 1 Stats (udpated after class)
Aver 44.7 89.3%
Max 50.0 100.0%
Min 32.0 64.0%
Median 46.0 92.0%
Thursday's quiz will be on classes,  1D arrays, 2D arrays, classes with instance variables, and a question that asks you to answer O(1), O(log n), O(n log n), O(n2), O(n3)
Practice Quiz 2 doc or pdf
Practice Quiz 2 Answers  doc or pdf

Homework

Take the practice quiz 
Complete Project 3 Game of Life: Due tonight 10:00pm

Lecture Outline

Slides 1..10 of 06-CollectionConsiderations.ppt   (Reading Chapter 6 is optional)
Code demo has class ObjectCollection as a heterogeneous collection
Need 5 volunteers to demonstrate Selection Sort
Add a sort method to ObjectCollection
Demonstrate varying runtimes of this Sort that is O(n2)

Lab in 930GS

See  Labs page
Complete 4 1D array problems on JavaBat
Sort the colors of the rainbow: 
If necessary, and time permits, work on your GameOfLife project (due at 10:00 pm tonight)

 

Tuesday 17-June

Announcements

Thursday's quiz will be on classes,  1D arrays, 2D arrays, and classes with instance variables

Homework

Work on Project 3 Game of Life: Due Wednesday 10:00pm

Lecture Outline

Algorithm Analysis (or which Big O is it? 1, log n, n, n log n, n2, or n3)
05-AlgorithmAnalysis.ppt
Demo Sequential and BinarySearch as humans
Demo Sequential and BinarySearch at runtime from the command line CompareSearches.java
Get to the folder that holds CompareSearches.class
To search an array of 500 Objects, enter java CompareSeaches 500 
In class activity: In teams of 2, count the instructions and determines runtimes  
Note: We will work more with 1D arrays on Wednesday  (sorting and JavaBat problems)
Break, meet back at TBA
Get back to 2D arrays
Add another method to Matrix.java: Transpose

      

 
Present Project 3: GameOfLife

Lab in 930GS

Begin GameOfLife

 

Monday 16-June

Announcements

Song/SongTest lab extended to 5:00 pm today

Homework

Read Chapter 5: Algorithm Analysis  (all 16 pages)
Answer Self-Checks as you go (answers on course page)
Complete Project 2 (due at 10:00 pm tonight): see Projects Page
Begin Project 3 (one method at a time)

Lecture Outline

Questions on current project: Descriptive Statistics?
How about at least one example of Standard Deviation?
We had better read the criteria.  I saw one person sorting the array during each addInOrder
Add four more methods to our String227 class
toString()
toUpperCase()
replace(char, char)  (you write the code)
compareTo(String227)
Two-D Arrays
int[][] twoDArray = { { 1, 2, 3, 4 }, 5, 6, 7, 8 } };
Code Demo: Process2DArrayTest with methods 
double range()
putSumInDiagonal()
leave other elements unchanged
Introduce Project 3: GameOfLife  See Projects page

Lab in 930GS

Required: Matrix 3.pdf
When done, raise your hand, I will check your solution
If time permits, work on any of these
Song/SongTest from Chapter 4
Descriptive Statistics
Project 3: GameOfLife

 

Thursday 12-June

Announcements

Here are the answers to Practice Quiz 1  

Homework

Read Chapter 3: Implementing Types as Java Classes (10 pages)
Complete class Song its unit test SongTest,  turnin via WebCat by Monday 12:50pm
Work on Project 2: see Projects Page

Lecture Outline

Quiz review 
Quiz: 35 minutes, plus 5 minute break (or use those 5 minutes to go finish quiz 1)
return at: time TBA
Introduce arrays  2-79 .. 2-90
Add these methods to lecture's ControlFun
public int sumArray(int[] x, int leftIndex, int rightIndex) to return the sum of elements in the given range of indexes
public void increment(double[] x, double inc)  to add inc to all array elements from index 0 through x.length-1 inclusive
public int[] doubleArray(int[] x) to return an array of twice the size with elements repeated next to each other:  doubleArray( { 1, 2, 3 } ) returns  { 1, 1, 2, 2, 3, 3 }
Introduce TDD
Complete BankAccount we started with a deposit and withdraw method
Begin a mutable String class named String227

/**

 * Construct a mutable String object with a java.lang.String

 */

public String227(String initialString) {
}

/**

  * Return the number of chars in this String227 object.

  */

public int length() {

  return 0;
}


/**

  * Returns the char value in this sequence at the specified index. The first

  * char value is at index 0, the next at index 1, and so on, as in array

  * indexing. The index argument must be greater than or equal to 0, and less

  * than the length of this sequence.

  */

public char charAt(int index) {
    return ' ';
}

 

/**

  * Return all chars from beginIndex up to, but not including endIndex as s

  * String227 object.

  *

  * Precondition: beginIndex >= 0, endIndex <= this object's

  * length, and beginIndex < endIndex

*/

public String227 substring(int beginIndex, int endIndex) {

     return null;
}

Introduce Project 2: Descriptive Statistics (see Projects page)

Lab in 930GS

Three JavaBat array problems: countEvens, bigDiff, and centeredAverage 
Raise your hand when done 
If time permits, begin reading Chapter 4 and complete class Song and a unit test 
this lab is due via WebCat by 12:50 pm Monday.

Wednesday 11-June

Announcements

Quiz 1 Thursday 12-June