Skip to content

Latest commit

 

History

History

collections-utilities-and-dates

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

week 14

This week we will review collections, and talk about various topics in Chapter 15.

Related youtube video playlist

Agenda

  • Homework questions
  • Homework comments
  • comparing floating point numbers is hard
  • Integers do division with truncation in Java, FP are the correct thing to use for division.
  • How to remove punctuation? RegEx of course: .replaceAll(",|!|\\.|\"", "")
  • Topic: Arrays util
  • In class work: create an array, sort it, then do binary search on it.

Example of an FP rounding error.

> 0.3 === 0.2 + 0.1
false

// How do you deal with this?
// you use an error factor:
> 0.3 - (0.2 + 0.1) < 0.00000000001
true

Topics (new content)

  • copying an array
  • comparing arrays
  • sorting arrays (Comparable interface, and comparator classes)
  • binarySearch on array.
  • Date objects
  • Calendar objects
  • Regex (Matcher and mather.find())