Algorithms and OOD (CSC 207 2014F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [Learning Outcomes] [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Student-Curated Resources] [Java 8 API] [Java 8 Tutorials] [Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2014S (Rebelsky)] [CSC 207 2014F (Walker)] [CSC 207 2011S (Weinman)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Overview
System.out
, presumably because it's simpler.java.io.PrintWriter
objects because
String.split
.)git add .
, git commit
, git push
I like doing lots of randomized tests. How do you design a randomized test? Often, you start with the answer and then work backwards.
average
: Pick a random number, r
, between Integer.MIN_VALUE/2
and Integer.MAX_VALUE/2
. Pick another random number, o
, between
0 and Integer.MAX_VALUE/2
. average(r+o, r-o)
should be r
.
sort
: Build a sorted array. Permute it. Sort it. See if you
get something equivalent to the original array.You should also consider the likely edge and corner cases, typically involving extremes.
Systematic tests are also great. We'll look at a systematic test for binary search.