Skip to content

rafaelnec/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms

Example of algorithms in Java

Support Files

Linux

Mac

Quick Union

Description: For solving the so-called dynamic connectivity problem.

Link: Quick Union

Percolation

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

Queue

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

Stack

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

About

Example of algorithms in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages