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.
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.
- May 23rd: FirstJava.java
- May 24th: Conditions.java,
Switch.java,
Randomness.java,
Loops.java, Factorial.java
(loops and writing your own static methods).
- May 25th:
TestStack.java, Postfix
Calculator, FindMistakes.java
- May
27th: IntArray.java, StringArray.java, Starting
code for
"waves", Chess.java
(a two-dimensional array)
- May 27th: TestArrayList.java, Exercise on ArrayList
- May 31st:
-
June 1st: Review for Midterm I,
Solutions,
Java exceptions.
-
June 3rd: Java interfaces,
Linked List starting code.
- June 7th: Linked list, work in progress.
- June 8th: Iterators
examples,
our Queue interface.
- June 9th: typecasting
and
instanceof
examples,
Sorting methods.
- June 10th: 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"). The
final version of counting sort.
- June 13th: Review for Midterm
II,
selected solutions for
review questions., Final version of
OurLinkedList
class.
- June 15th: Radix sort animation (very slow - be patient!), JUnit example, Priority queue JUnit and starting code.
- June 15th lab: PriorityQueue work in progress, Starting code for a priority heap.
- June 16th: Binary Search Tree.
Two in-progress versions: Sci 2185, the CSci lab.
- June
17th.
AVL trees
(wikipedia), in
particular an
illustration of
rotations, AVL
tree interactive animation.
- June 21st, June 22nd: Wikipedia
article on
hashtables, Starting code
for hashtables (with starting JUnit tests),
Starting code for graphs.
- June 23rd: Review for the final, Java graphical user interfaces
(GUIs): A simple GUI example, A
somewhat more involved example
Standard Java classes and interfaces used in the course
Downloads
- jEdit text
editor. You may need a recent version
of Java
run-time environment (JRE) before you can install jEdit.
- Java
Development Kit (JDK). On Windows you may also need to set
the PATH environment
variable. 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 ;. 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
.
Reading materials
Resources