Need help with Algorithms?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

williamfiset
11.2K Stars 3.0K Forks MIT License 1.5K Commits 72 Opened issues

Description

A collection of algorithms and data structures

Services available

!
?

Need anything else?

Contributors list

# 420
Java
graph-t...
mathema...
Python
1011 commits
# 14,045
Java
Firebas...
hash-ta...
Python
20 commits
# 4,264
Java
Python
matrix-...
search-...
9 commits
# 23,157
matrix-...
search-...
ml
fedora
6 commits
# 32,810
Java
matrix-...
search-...
Shell
6 commits
# 41,160
Java
matrix-...
search-...
Kuberne...
4 commits
# 47,652
Java
matrix-...
search-...
Redis
3 commits
# 49,154
matrix-...
search-...
Shell
python3
3 commits
# 49,566
Java
Python
matrix-...
search-...
3 commits
# 49,562
Java
Python
matrix-...
search-...
3 commits
# 62,097
Java
Python
matrix-...
nlog
2 commits
# 28,355
matrix-...
nlog
Node.js
Jupyter...
2 commits
# 37,279
cpp17
vscode
rust-la...
Shell
2 commits
# 48,775
Java
matrix-...
nlog
CSS
2 commits
# 62,110
Java
Python
matrix-...
nlog
2 commits
# 59,751
scannet
shapene...
React
Markdow...
1 commit
# 88,489
Java
Python
matrix-...
nlog
1 commit
# 88,746
Java
Python
matrix-...
nlog
1 commit
# 88,249
matrix-...
nlog
Shell
cpp17
1 commit
# 88,756
Java
Python
matrix-...
nlog
1 commit

License: MIT Java CI with Gradle README Checker Donate

Algorithms & data structures project

Algorithms and data structures are fundamental to efficient code and good software design. Creating and designing excellent algorithms is required for being an exemplary programmer. This repository's goal is to demonstrate how to correctly implement common data structures and algorithms in the simplest and most elegant ways.

Contributing

This repository is contribution friendly :smiley:. If you'd like to add or improve an algorithm, your contribution is welcome! Please be sure to checkout the Wiki for instructions.

Other programming languages?

This repository provides algorithm implementations in Java, however there are other forks that provide implementations in other languages, most notably:

  • C++/Python: https://github.com/akzare/Algorithms
  • Rust: https://github.com/TianyiShi2001/Algorithms

Running an algorithm implementation

To compile and run any of the algorithms here, you need at least JDK version 8. Gradle can make things more convenient for you, but it is not required.

Running with Gradle (recommended)

This project supports the Gradle Wrapper. The Gradle wrapper automatically downloads Gradle at the first time it runs, so expect a delay when running the first command below.

If you are on Windows, use

gradlew.bat
instead of
./gradlew
below.

Run a single algorithm like this:

./gradlew run -Palgorithm=.

Alternatively, you can run a single algorithm specifying the full class name

./gradlew run -Pmain=

For instance:

./gradlew run -Palgorithm=search.BinarySearch

or

./gradlew run -Pmain=com.williamfiset.algorithms.search.BinarySearch

Compiling and running with only a JDK

Create a classes folder

cd Algorithms
mkdir classes

Compile the algorithm

javac -sourcepath src/main/java -d classes src/main/java/ 

Run the algorithm

java -cp classes 

Example

$ javac -d classes -sourcepath src/main/java src/main/java/com/williamfiset/algorithms/search/BinarySearch.java
$ java -cp classes com.williamfiset.algorithms.search.BinarySearch

Data Structures

Dynamic Programming

Dynamic Programming Classics

Dynamic Programming Problem Examples

Adhoc

Tiling problems

Geometry

Graph theory

Tree algorithms

Network flow

Main graph theory algorithms

Linear algebra

Mathematics

Other

Search algorithms

Sorting algorithms

String algorithms

License

This repository is released under the MIT license. In short, this means you are free to use this software in any personal, open-source or commercial projects. Attribution is optional but appreciated.

Donate

Consider donating to support my creation of educational content:

paypal

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.