Computer Science 126
General Computer Science
Fall 2014


Course Information | People | Assignments | Lectures | Precepts | Exams | Booksite

Precepts

Worksheets and Code. The worksheets are .pdf files suitable for on-line viewing or printing. The Code link can be copied and pasted into DrJava for convenient completion of the programming exercise. Often the solutions are available on the booksite (if an exercise number is listed).

Recommended Exercises. These are optional exercises we recommend you do at home to build your skills.

Websheets. These are programming exercises you can type and submit in your browser that include basic tests of correctness. They give you instant feedback and have reference solutions.

Visualizer. When tracing Java code, this visualizer tool can help you see exactly what Java does in each step of the process.

# DATE TOPICS WORKSHEETS CODE FOR EXERCISES RECOMMENDED EXERCISES WEBSHEETS
NO COS126 PRECEPTS on 9/10
1 9/11, 9/12 Intro, HelloWorld,
Command-line Arguments
First Programs
Assignment Guidelines
Treasure Hunt
HelloWorld
NameAge
NextYear
NameAge Solution
NextYear Solution
1.1.1–4
1.2.7
HelloWorld
NameAge
NextYear
SquareOf
SquareSwap
2 9/16, 9/17 Data Types
(Bring textbook to precept.)
Data Types
Data Types Table
Data Types Table Solution
WindChill
Distance
ThreeSort
1.2.4, 1.2.6, 1.2.9, 1.2.13, 1.2.16,
1.2.20 (hint: study Program 1.2.5 on p.33),
1.2.25, 1.2.30, 1.2.34, WebExercise 1.2.1
Eggsactly
PercentScore
PizzaCalculator
WindChill
Distance
ThreeSort
3 9/18, 9/19 Conditionals and Loops Conditionals and Loops
Debugging
RollDie
RollLoadedDie
Buggy1FivePerLine
Buggy2FivePerLine
Buggy3FivePerLine
Buggy4FivePerLine
1.3.7, 1.3.8, 1.3.13, 1.3.16 (Booksite 1.3.15),
1.3.20, WebExercises 1.3.1, 1.3.2
Flag
AgeChecker
SquareCensus
Quadratic
ModularSqrt
4 9/23, 9/24 Arrays, StdIn Arrays
StdIn
Command-line cheatsheet
Command-line tutorial
ArrayRef
HowMany
Distinct
MysteryArray
Birthday
MaxMin
Students
students.txt data file
DiscreteDistribution
1.4.4, 1.4.9, 1.4.10 (Hint: start with Deck.java from lecture),
1.4.13, WebExercises 1.4.1, 1.4.2,
Booksite Creative Exercise 1.4.35 (both parts)
1.5.1, 1.5.3, 1.5.11, 1.5.13, 1.5.15, WebExercise 1.5.31
Distinct
Reverse
NOrdered
NSwap
Commonest
5 9/25, 9/26 StdDraw, NBody StdDraw CheckerBoard
DeluxeBouncingBall
Optional media:
TennisBall.png,
pipebang.wav
1.5.18, 1.5.21, 1.5.22 MaxMin
Students
Powers
Squish
Means
6 9/30, 10/1 Functions Methods
Methods and StdDraw
Perimeter
Maxi
Reverse
DiamondTile
Perimeter
2.1.1, 2.1.3, 2.1.4, 2.1.13, 2.1.14
WebExercise 2.1.35
Positive
Find
Boxed
Summer
Yarra
7 10/2, 10/3 More StdDraw, Recursion Recursion
Htree
NestedCircles
Factorial
Htree
NestedCircles
WebExercise 2.1.1, 2.3.3, 2.3.8, 2.3.14, 2.3.22 Kettles
Factorial
TextFractal
BinarySum
Evaluate
ZeroSum
8 10/7, 10/8 Performance, Review Repeat
Practice Mini-Exam
Repeat
Practice Mini-Exam Answers
4.1.10, 4.1.16, 4.1.27
9 10/9, 10/10 Dynamic Programming Fibonacci Programs
Sequence Alignment
Recursive Fibonacci
Dynamic Programming of Fibonacci
Catalan
PartitionCount
Mario
Knapsack
KnapsackBacktrack
10 10/14, 10/15 Using Data Types Charge client PlayTime
FourChargeClient Charge
ColorSeparation peppers.jpg
Picture API (Picture.java)
Color API
3.1.1, 3.1.6 (Booksite Creative Exer. 3.1.60),
3.1.13 (Booksite 3.1.25),
3.1.14 (Booksite 3.1.30),
Booksite 3.1.14 (answer on p.340)
FourChargeClient
IsPalindrome
ComplementaryDNA
CircularShift
GeneFind
11 10/16, 10/17 Creating Data Types Ball object and client Stopwatch.java
Person.java
Ball, BouncingBalls
BouncingBall (§1.5)
3.2.5, 3.2.11 (Point.java code on Booksite) Recorder
Clicker
CountingSort
CombinationLock
Monomial
12 10/21, 10/22 Number Systems
and Bitwise Operators
Number Systems Number Systems Answers Booksite 5.1.1, 5.1.16 (~ means complement), 5.1.18
13 10/23, 10/24 No precept. Programming
Midterm 1 in the evening.
Practice programming exams
HatsPart1
HatsPart2
FoodPart1
FoodPart2
14 11/4, 11/5 More Data Types, Searching, Guitar Hero OOP Example: Vector Vector.java 3.3.6 (answer in book),
3.3.7 (answer in Vector.java in Booksite 3.3)
Name
Interval
Vector
Lambert
15 11/6, 11/7 ADTs, Stacks and Queues, Sorting Stacks and Queues 4.2.4, 4.2.6, 4.3.1, 4.3.3, 4.3.4, 4.3.8, 4.3.9, 4.3.16 QMerge
LineEdit
16 11/11, 11/12 Symbol Tables, Generics, Markov Symbol Tables
FrequencyTable
FrequencyTable.java
ST.java
mobydick.txt
4.4.8, 4.4.9, 4.4.23, 4.4.36 (Booksite Creative Ex 4.4.5) FrequencyTable
ReverseLookup
17 11/13, 11/14 Linked Structures (Lists and Trees) Binary Search Trees
Quote
Binary Trees solution 4.3.23, 4.3.25, 4.3.26, 4.3.27, Web Exer. 4.3.1, 4.3.2
MonkeyTraverse
MonkeyAddStart
MonkeyAddEnd
Quote
LinkIt
18 11/18, 11/19 RE and DFA RE and DFA RE and DFA Answers
Challenge for the bored
Fall12 Exam2 #4 RegularExercise
19 11/20, 11/21 Turing Machines,
TSP heuristics
Turing Machines
CircularQuote
Turing Machines answers Spr13 Exam2 #8 CircularQuote
NO COS126 PRECEPTS on 11/25. Happy Thanksgiving!
20 12/2, 12/3 Theory, Boolean Algebra/Circuits Theory Jigsaw
Boolean Algebra/Circuits
Theory Jigsaw Entries (click table)
Boolean Algebra Answers
Practice your Theory (solutions)
21 12/4, 12/5 Circuits/Architecture, TOY Circuits Match-up
TOY + Reference Card
Circuits Match-up Checker
TOY Answers
5.3.2, 5.3.6, 5.3.12, 5.4.8, 5.4.9, 5.4.12
Practices for programming midterm 2: Fall 2013 (MiniPro, MiniPro2) Spring 2010 (BinaryInteger)
22 12/9, 12/10 Review Jeopardy!
Practice Exam
Jeopardy! (click "Review Mode")
Practice Exam Answers

Written Midterm 2 Thursday morning
No regular precept 12/11, 12/12.
Final Project Help Page
Final project due in January.
Topics, worksheets and exercises below are still tentative for Fall 2014


Copyright Robert Sedgewick and Kevin Wayne.