Computer Science 126
General Computer Science
Spring 2013


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

Precepts

Here is the tentative schedule of precepts. Links will be updated throughout the term. All Exercise numbers refer to Introduction to Computer Science by R. Sedgewick and K. Wayne. The textbook Introduction to Programming in Java: An Interdisciplinary Approach contains Chapters 1–4. The remaining chapters are unpublished.

Worksheets. The worksheets are .pdf files suitable for on-line viewing or printing (for hand-written completion of the programming exercise).

Code for exercises. This fill-in-the-blank code can be copied and pasted into DrJava for convenient completion of the programming exercise. If an Exercise number is listed in the header comments, then the solution code is on the Booksite.

Recommended exercises. These include exercises done during precept and exercises to be done independently.

# DATE TOPICS WORKSHEETS CODE FOR EXERCISES RECOMMENDED EXERCISES
1 2/5, 2/6 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
2 2/7, 2/8 Data Types
(Bring textbook to precept.)
Data Types Jigsaw
Data Types
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
3 2/12, 2/13 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
4 2/14, 2/15 Arrays Arrays
DiscreteDistribution
HowMany
Distinct
MysteryArray
Birthday
DiscreteDistribution
SecretMessage
Distinct solution
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)
5 2/19, 2/20 StdIn, Parallel Arrays, NBody StdIn
Terminal/CommandPrompt
MaxMin
Students
students.txt data file
1.5.1, 1.5.3, 1.5.11, 1.5.13, 1.5.15, WebExercise 1.5.31
6 2/21, 2/22 StdDraw, Functions StdDraw
Functions
StdDraw and Methods
DeluxeBouncingBall
CheckerBoard
Maxi
Reverse
DiamondTile
1.5.18, 1.5.21, 1.5.22,
2.1.1, 2.1.3, 2.1.4, 2.1.13, 2.1.14
WebExercises 2.1.1, 2.1.35
7 2/26, 2/27 More StdDraw, Recursion Recursion
Htree
NestedCircles
Factorial
Htree
NestedCircles
2.3.3, 2.3.8, 2.3.14, 2.3.22
8 2/28, 3/1 Performance, Sorting Repeat
Insertion
InsertionTest
4.1.10, 4.1.16, 4.1.27
Practice Programming Test
Data files
file1.txt
file2.txt
file3.txt
SortAndDraw
9 3/5, 3/6 Number Systems
TOY
Number Systems
TOY
TOY cheat sheet
Number Systems Answers
TOY Answers
Booksite 5.1.1, 5.1.16 (~ means complement or flipped bits), 5.1.18
5.3.2, 5.3.6, 5.3.12, 5.4.8, 5.4.9, 5.4.12
10 3/7, 3/8 More TOY
Practice Mini-Exam
Practice Mini-Exam Answers
Practice Programming Test 2
Data files
fivepoints.txt
canon.txt
stz.txt
map.png
PUPoints
PUHeatMap
11 3/12, 3/13 Hamming Codes
12 3/14, 3/15 NO COS126 PRECEPTS Programming Exam 3/14 7:30pm
Please fill out the anonymous midterm evaluation thoughtfully.
Have a re-energizing spring break!
13 3/26, 3/27 Using Data Types Charge client PlayTime
FourChargeClient
Charge
ColorSeparation
Picture API (source)
peppers.jpg
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)
14 3/28, 3/29 Creating Data Types Ball object and client Stopwatch source
Person example
BouncingBall
Ball
BouncingBalls
3.2.5, 3.2.11 (Point.java code on Booksite), Booksite Creative Exercise 3.2.31 (use data file from Precept 5 students.txt)
15 4/2, 4/3 More OOP
ADT: Stacks and Queues
Guitar Hero
OOP Example: Vector
Stacks and Queues
Vector 3.3.6 (answer in book), 3.3.7 (answer in Vector.java in Booksite 3.3),
4.3.1, 4.3.3, 4.3.4, 4.3.8, 4.3.9, 4.3.16
16 4/4, 4/5 BST
Linked Lists
BST
Linked List Code
Quote 4.3.23, 4.3.25, 4.3.26, 4.3.27, Web Exer. 4.3.1, 4.3.2
4.4.8, 4.4.9
17 4/9, 4/10 Generics
Symbol Tables
MarkovModel
ST Key, Value types
ST Programming Example
FrequencyTable.java
ST.java
mobydick.txt
4.4.23, 4.4.36 (Booksite Creative Ex 4.4.5)
18 4/11, 4/12 RE and DFA RE and DFA RE and DFA Answers Fall09 Exam2 #2
Fall08 Exam2 #4
19 4/16, 4/17 Turing Machines,
TSP heuristics
Turing Machine CircularQuote fill-in-the-blank
CircularQuote.java
Fall08 Exam2 #7
20 4/18, 4/19 Universality, Computability,
Intractability
Theory Jigsaw
Theory Quiz
Theory Jigsaw Entries
Theory Quiz Answers
21 4/23, 4/24 Boolean Expressions,
Combinational Circuits,
Sequential Circuits
Combinational Circuits Combinational Circuits Answers
22 4/25, 4/26 Architecture,
Scientific Computing
TOY Architecture
Scientific Computing
TOY Architecture answers
Scientific Computing answers
Practice Mini-Exam
Practice Mini-Exam Answers
Practice Programming Exam
test main() for Event
test main() for Day
test main() for Calendar
Event
Day
Calendar
23 Tue 4/30 NO COS126 Precepts
24 We 5/1, Th 5/2 Final Project
25 Fri 5/3 NO COS126 PRECEPTS
Topics, worksheets and exercises below are still tentative for Spring 2013


Copyright © 2011, Robert Sedgewick and Kevin Wayne.