CSci 2101: Data Structures - Resources.
[Home]
[Syllabus]
[Assignments]
[Resources]
This page has resources and examples for the course and links to other helpful
materials. The materials will be added as needed.
Introduction to Coding Dojo programming
In class we will be using a collaborative programming learning
approach known as
Coding Dojo.
We will be using a slightly modified Randori version of Coding Dojo.
In a nutshell, the approach involves a group of learners and a single
computer connected to a video screen. The learners, in turn, take on
the following two roles: a driver who is typing a part of the
program on the keyboard and a navigator (a.k.a. co-pilot) who
helps the driver when she/he is uncertain how to procede. The entire
group
particpates in discussing the program being designed. If a
discussion takes place, the navigator is responsible for directing
that discussion, including making sure that a conclusion is reached in
a timely manner.
Every five minuters or so participants switch: the navigator
becomes the new driver, and a new navigator is selected.
The practice is very successful for learning groups, provided that
everyone in the room is paying attention and
participates. Participation in Coding Dojo
is a part of your class participation grade.
No participant is allowed to try code on their own computer during a
Coding Dojo.
In-class examples
- How to compile and run Java programs: when using jEdit to write
your program:
- In the lab: open a terminal window; on a Windows machine start a
command prompt window.
- Type
cd
followed by space followed by the location of
your Java file. For instance, in the lab it may be
cd 2101/lab1
and on Windows
cd Desktop\2101\lab1
Press enter, make sure the command executed successfully.
-
Suppose your file is
FirstJava.java
. Compile it by typing
javac FirstJava.java
If this gives error messages, correct the errors, save the file, and
recompile. Use "up" arrow key so that you don't have to retype the
command. Note that if you get "file not found" error, you are in the
wrong place or are mistyping the file name. If you get an
"unrecoginzed command" or a similar error, make sure that java
compiler is installed on your system.
-
After the program compiles with no errors, type
java FirstJava
(assuming that FirstJava is the name of your program). Note that you
don't put .class or .java after the program name.
- August 29th: FirstJava.java.
- August 31st: Conditions.java,
Loops.java, Randomness.java.
- September 2nd: Switch.java, Writing your own methods
- September 7th:
Factorial.java,
TestStack.java, Postfix
Calculator, FindMistakes.java
- September 12th:
Postfix
Calculator
- September 14th: IntArray.java, StringArray.java.
-
September 16th: Starting
code for
"waves", Chess.java
(a two-dimensional array), TestArrayList.java, Exercise on ArrayList
-
September 19th: Chess.java
(a two-dimensional array), TestArrayList.java, Exercise on ArrayList.
Writing your own classes: Person
class example.
-
September 21st: Review for Midterm I.
- September 26th: Java exceptions,
The very beginning of implementing a card game "War":
The testing code for the Card class.
- October 3rd: Java interfaces,
Linked List starting code.
- October 10th: Iterators
examples,
our Queue interface.
- October 12th: typecasting
and
instanceof
examples
- October 14th: Sorting methods.
- October 25th: JUnit example, Priority queue JUnit and starting code.
- October 28th: non-comparison
sorting. Counting sort
files (uses abstract
classes), A
good description of counting
sort, A
very nice visualization of counting sort (just disregard the
title "radix sort").
- October 31st: Review for Midterm
II.
-
November 4th: Starting code for
a priority heap. You may use your JUnit testing code for
priority queue to test a priority heap since they should work the
same.
- November 8th: Binary Search Tree.
- November 14th.
AVL trees
(wikipedia), in
particular an
illustration of
rotations, AVL
tree interactive animation.
- November 21st: Wikipedia
article on
hashtables, Starting code
for hashtables (with starting JUnit tests)
- November 28th: A sample AVL tree solution (a zip archive)
- November 29th: Starting code for
graphs, the same code
to download (zip archive)
-
Java graphical user interfaces
(GUIs): A simple GUI
example, A somewhat more
involved
example, downloadable zipped
project with the examples.
- December 9th: Review for the final
Standard Java classes and interfaces used in the course
Downloads
- Java
Development Kit (JDK):
- On Windows: Java 6 download. Get a Windows installer
(the .exe file) and run it.
You will also need to set
the PATH environment
variable, see Instructions
for accessing the PATH variable.. After you click on Edit, put
; at the end of the current value of PATH and then copy/paste the
path to javac
after the ;. Do not remove or overwrite anything that's currently in the PATH variable! The path usually is: your
Program Files folder, then Java folder, then the JDK folder that
you have just installed, and then bin
. For instance,
on my Windows 7 computer the path is C:\Program Files
(x86)\Java\jdk1.6.0_20\bin
.
Installation instructions provide more information.
- On a Mac: JDK should come with the OS. For more information see this discussion.
- jEdit text
editor. Make sure to install the JDK first, it comes with Java Runtime Environment (JRE) which is needed to run jEdit.
- Eclipse download> This is a general eclipse downloads page: http://www.eclipse.org/downloads/
Reading materials
Resources