UNC-CH COMP 410
Examples Used in Class
in class 8/23/11
       
Basic Sorting: Bubble Sort
       
       
Timing version of the sort
       
sort algorithm comparison
in class 8/30/11
       
proof by contrapositive
in class 8/30/12
       
O(2^N) vs. O(N)
       
random numbers in Java
       
timing programs in Java
in class 9/04/12
       
list ADT basics
in class 9/06/12
       
ADT Axiomatic Semantics
in class 9/25/12
       
AVL tree animation
in class 10/11/12
       
Code for Hash Table
in class 11/13/12
       
creating a Java priority queue
shows how to write a comparator so you can order Java objects, or alter the
normal ordering on things like integers.
Note in this example the "compare" function code is provided inline
right after "new Comparator"; the new inline Comparator object is then
passed to the constructor for the Priority Queue.