[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Project] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Exams] [Examples] [Book] [Tutorial] [API]
Back to Simple Graph Algorithms. On to Graphs, Concluded.
Held Friday, December 3, 1999
Overview
Today, we consider a variety of techniques for solving the shortest path problem, including an adapation of the breadth-first reachability solution and a brute-force method.
Notes
public class ListComparator
implements Comparator
{
...
/**
* Create a new list comparator that compares individual
* list elements using compare.
*/
public ListComparator(Comparator compare) {
...
} // ListComparator(Comparator)
...
}
CursoredLists.
/**
* Determine if two lists are equal.
*/
public void equals(Object a, Object b)
throws IncomparableException
{
CursoredList listA;
CursoredList listB;
if (a instanceof CursoredList) {
listA = (CursoredList) a;
}
else {
throw new IncomparableException("Not a cursored list");
}
if (b instanceof CursoredList) {
listB = (CursoredList) b;
}
else {
throw new IncomparableException("Not a cursored list");
}
...
} // equals(Object,Object)
public void equals(Object a, Object b)
throws IncomparableException
{
try {
CursoredList listA = (CursoredList) a;
CursoredList listB = (CursoredList) b;
// ...
return ...;
}
catch (ClassCastException e) {
throw new IncomparableException("Not a cursored list");
}
} // equals(Object,Object)
Contents
Summary
Tuesday, 10 August 1999
Thursday, 2 December 1999
Monday, 6 December 1999
Back to Simple Graph Algorithms. On to Graphs, Concluded.
[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Project] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Exams] [Examples] [Book] [Tutorial] [API]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS152/99F/Outlines/outline.52.html
Source text last modified Mon Dec 6 09:45:14 1999.
This page generated on Mon Dec 6 09:56:46 1999 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu