|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--Opus5.Algorithms
Various algorithms.
| Constructor Summary | |
Algorithms()
|
|
| Method Summary | |
static void |
breadthFirstTraversal(Tree tree)
Traverses a tree breadth-first, printing each node as it is visited. |
static void |
calculator(java.io.Reader in,
java.io.PrintWriter out)
A reverse-polish calculator. |
static Digraph |
criticalPathAnalysis(Digraph g)
Computes the critical path in an event-node graph. |
static Digraph |
DijkstrasAlgorithm(Digraph g,
int s)
Dijkstra's algorithm to solve the single-source, shortest path problem for the given edge-weighted, directed graph. |
static void |
equivalenceClasses(java.io.Reader in,
java.io.PrintWriter out)
Computes equivalence classes using a partition. |
static Digraph |
FloydsAlgorithm(Digraph g)
Floyd's algorithm to solve the all-pairs, shortest path problem for the given edge-weighted, directed graph. |
static Graph |
KruskalsAlgorithm(Graph g)
Kruskal's algorithm to find a minimum-cost spanning tree for the given edge-weighted, undirected graph. |
static Graph |
PrimsAlgorithm(Graph g,
int s)
Prim's algorithm to find a minimum-cost spanning tree for the given edge-weighted, undirected graph. |
static void |
translate(java.io.Reader dictionary,
java.io.Reader inputText,
java.io.PrintWriter outputText)
Reads a dictionary and then translates the words in an input text word-by-word, printing the result on the output stream. |
static void |
wordCounter(java.io.Reader in,
java.io.PrintWriter out)
Counts the number of distinct words in the input stream and then prints a table of the words and the number of occurrences on the output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Algorithms()
| Method Detail |
public static void breadthFirstTraversal(Tree tree)
tree - The tree to traverse.Queue
public static void equivalenceClasses(java.io.Reader in,
java.io.PrintWriter out)
throws java.io.IOException
in - The input stream.out - The output stream.java.io.IOException - If an error occurs while reading input.Partition
public static Digraph DijkstrasAlgorithm(Digraph g,
int s)
g - An edge-weighted, directed graph.
It is assumed that the edge weights are Intss - The start vertex in the graph.public static Digraph FloydsAlgorithm(Digraph g)
An - edge-weighted, directed graph.
It is assumed that the edge weights are Ints
public static Graph PrimsAlgorithm(Graph g,
int s)
g - An edge-weighted, undirected graph.
It is assumed that the edge weights are Intss - A vertex from which to begin constructing the spanning tree.public static Graph KruskalsAlgorithm(Graph g)
g - An edge-weighted, undirected graph.
It is assumed that the edge weights are IntsPartition,
PriorityQueuepublic static Digraph criticalPathAnalysis(Digraph g)
g - An edge-weighted, directed acylic graph.
It is assumed that the edge weights are Ints
public static void calculator(java.io.Reader in,
java.io.PrintWriter out)
throws java.io.IOException
+, * and =.in - The input stream.out - The output stream.java.io.IOException - If an error occurs while reading input.Stack
public static void wordCounter(java.io.Reader in,
java.io.PrintWriter out)
throws java.io.IOException
in - The input stream.out - The output stream.java.io.IOException - If an error occurs while reading input.HashTable
public static void translate(java.io.Reader dictionary,
java.io.Reader inputText,
java.io.PrintWriter outputText)
throws java.io.IOException
dictionary - An input stream from which the pairs of words are read.inputText - The input stream to be translated.outputText - The output stream on which to print the translation.java.io.IOException - If an error occurs while reading input.SearchTree
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||