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.
- January 13th: FirstJava.java.
- January 15th: Conditions.java,
Loops.java, Randomness.java.
- January 22nd: switch statements, Writing your own methods
- January 24th: Solutions for exercises on methods
- January 27th:
Factorial.java,
TestStack.java, download the current work in progress on the test stack exercise, Postfix
Calculator
- January 28: A solution for the stack problem that we developed in class
- January 31: Stack sharing example we did in class
- February 3: IntArray.java, StringArray.java.
-
February 5:
Chess.java
(a two-dimensional array), TestArrayList.java, Exercise on ArrayList
Writing your own classes: Person
class example. The code we've written in class.
- February 10: Java exceptions,
The very beginning of implementing a card game "War":
The testing code for the Card class. The card class that we wrote during the lab: Card.java
-
February 12: Review for Midterm I.
- February 20: overview of Java inheritance, more on Java
exceptions, Java interfaces,
Linked List starting code.
- March 4th: typecasting
and
instanceof
examples
- March 4-5: Iterators
examples,
our Queue interface.
- March 17: The linked list
class that we have written and JUnit tests for it
- March 17-18: Priority queue JUnit and starting code.
- March 21: Overview of Java
subtyping, using Java
predefined sorting, writing
our own sorting
methods
- March 26: Review for Midterm
II.
-
March 31: Sorting
continues: A
visualization of quick
sort, another
visualization of quicksort, as a Hungarian dance;
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").
-
April 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.
- April 9th: Binary Search Tree.
- April 14th.
AVL trees
(wikipedia), in
particular an
illustration of
rotations, AVL
tree interactive animation.
- April 23rd. Graphs.
- April 28th: Wikipedia
article on
hashtables, Starting code
for hashtables (with starting JUnit tests)
- April 28th. Lambda expressions in Java 8 and their use in data structures. Also see resources below for integrating Java 8 with Eclipse and for relevant Java 8 libraries.
- May 2nd: Review for the
final
Standard Java classes and interfaces used in the course
Downloads
- Java
Development Kit (JDK):
- On Windows: Java 7 download. If you have 64-bit Windows system, get a Windows x64 installer (the .exe file). If you have 32-bit Windows system, get Windows x86 installer.
On Windows 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\Java\jdk1.7.0_45\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/
- Updating Eclipse to Java 8: in addition to installing jre8 on
your machine you need to update Eclipse. To do that, you need to go
to
Help -> Install New Software
, then add the URL of
the library or a patch in the Work With
field and
click "Add". You will need to restart Eclipse. The specific patch
you need for Java 8
is this
one .
Reading materials
Resources