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.
- January 27th:
Loops.java, Randomness.java, switch statements.
- January 29th: Writing your own methods, Solutions for exercises on methods.
- February 1st:
TestStack.java, Postfix
Calculator, solutions for the stack exercises, work in progress on postfix calculator (just the very beginning).
- February 3rd: Factorial.java (recursion in Java)
- February 3rd:: An example of object sharing, with stacks.
- February 5th: IntArray.java, StringArray.java, Chess.java
(a two-dimensional array).
-
February 8th, 10th:
TestArrayList.java, Exercise on ArrayList, our (partial) solution.
-
February 12th:
Writing your own classes: Person
class example, The code we've written in class.
- February 15th: Java exceptions, Review for Midterm I.
- February 24: overview of Java inheritance, more on Java
exceptions, Java interfaces,
Linked List starting code.
- February 29:
Iterators examples, The strating point of the linked list class that we have developed so far.
- March 2: typecasting
and
instanceof
examples
- March 7:
Priority queue
- March 9:
Unit tests for priority queue
- March 11:
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. Counting sort solution we wrote in class.
-
March 29: 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.
- March 30: Binary Search Tree, Our work in progress..
- April 6: Review for Midterm
II.
- April 11.
AVL trees
(wikipedia), in
particular an
illustration of
rotations.
- April 18th. Graphs.
- April 25th: Wikipedia
article on
hashtables, Starting code
for hashtables (with starting JUnit tests)
- April 26th: Examples of using a comparator (with and without lambda expressions)
- April 27th: Materials on Java lambdas and generics
- May 2nd: Example of Java graphics
- May 6th: Review for the
final
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.
Reading materials
Resources