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.
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 20th: FirstJava.java.
- January 25th: Conditions.java, Randomness.java, Loops.java, switch statements.
- January 27th: Writing your own methods, Solutions that we have developed in class
- January 30th: TestStack.java,
Postfix
Calculator. Update: solutions for the stack exercises.
- February 3rd: Factorial.java (recursion in Java), An example of object sharing, with stacks, IntArray.java.
- February 6th: StringArray.java, Chess.java
(a two-dimensional array).
-
February 8th, 10th:
TestArrayList.java, Exercise on ArrayList, Solution for the exercise on ArrayList
-
February 10th, 13th:
Writing your own classes: Person
class example.
- February 15th: Review for Midterm I.
- February 21: Java exceptions, introduction to
Java inheritance.
-
February 27:
Linked List starting code.
-
March 1: Java interfaces,
Linked List code we wrote in the lab.
- March 6:
Iterators examples,
solution for Iterators examples
that we wrote in class.
- March 8:
typecasting
and
instanceof
examples,
Priority queue
- March 20:
Unit tests for priority queue
- March 22:
using Java
predefined sorting, writing
our own sorting
methods
Solution we wrote in class.
-
March 25: Sorting
continues: Sorting animation on different data patterns, a
visualization of quicksort, as a Hungarian dance;
non-comparison
sorting: Counting sort
files (uses abstract
classes), A
good description of counting
sort.
-
April 3rd: 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 5: Review for Midterm
II.
- April 10: Binary Search Tree, Our work in progress., Sample code with traversals
- April 12.
AVL trees
(wikipedia), in
particular an
illustration of
rotations.
- April 19. Graphs.
- April 26. Using comparator with priority queue (can also use the same approach for sorting)
- April 28: Wikipedia
article on
hashtables, Starting code
for hashtables (with starting JUnit tests)
- May 1: Materials on Java lambdas and generics.
- May 5: Review for the
final
- Not covered this semester, just FYI: Example of Java graphics
Standard Java classes and interfaces used in the course
Downloads
- Java
Development Kit (JDK):
- Java 8 downloads
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 8 computer the path is C:\Program Files\Java\jdk1.8.0_60\bin
.
Installation instructions provide more information.
- 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