Example of algorithms in Java
Description: For solving the so-called dynamic connectivity problem.
Link: Quick Union
Description: Given a composite systems comprised of randomly distributed insulating and metallic materials: what fraction of the materials need to be metallic so that the composite system is an electrical conductor? Given a porous landscape with water on the surface (or oil below), under what conditions will the water be able to drain through to the bottom (or the oil to gush through to the surface)? Scientists have defined an abstract process known as percolation to model such situations.
Link: Percolation
Command:
javac-algs4 PercolationVisualizer.java && java-algs4 PercolationVisualizer examples/input20.txt
javac-algs4 PercolationStats.java && java-algs4 PercolationStats 200 100
Description: A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).
Link: Queue
Command:
javac-algs4 Queue.java && java-algs4 Queue
javac-algs4 RandomizedQueue.java && java-algs4 RandomizedQueue
javac-algs4 Permutation.java && java-algs4 Permutation 4 < examples/distinct.txt
Description: Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Link: Stack
Command:
javac-algs4 Queue.java && java-algs4 Queue
javac-algs4 RandomizedQueue.java && java-algs4 RandomizedQueue
javac-algs4 Permutation.java && java-algs4 Permutation 4 < examples/distinct.txt