Algorithms  by williamfiset

Algorithm/data structure implementations in Java

created 8 years ago
18,094 stars

Top 2.5% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides a comprehensive collection of fundamental algorithms and data structures implemented in Java, aimed at developers and students seeking clear, elegant, and correct examples for efficient coding and software design. It serves as a valuable resource for understanding and applying core computer science concepts.

How It Works

The project meticulously implements common data structures (e.g., balanced trees, heaps, hash tables, tries) and algorithms across various domains like dynamic programming, geometry, graph theory, and string manipulation. Implementations prioritize clarity and correctness, often including complexity analysis and multiple approaches for a single problem (e.g., different sorting algorithms or graph traversal methods).

Quick Start & Requirements

  • Install/Run: Requires JDK 8 or higher. Gradle Wrapper is recommended for convenient compilation and execution.
    • Run a specific algorithm: ./gradlew run -Palgorithm=<algorithm-subpackage>.<algorithm-class>
    • Example: ./gradlew run -Palgorithm=search.BinarySearch
  • Alternative (JDK only):
    • Compile: javac -sourcepath src/main/java -d classes src/main/java/<relative-path-to-java-source-file>
    • Run: java -cp classes <class-fully-qualified-name>
  • Resources: No specific hardware requirements beyond a standard development environment. Setup is minimal if Gradle is available.
  • Links: Wiki for contribution instructions

Highlighted Details

  • Extensive coverage of data structures including AVL trees, Red-Black trees, Splay trees, Fenwick trees, and various heap implementations.
  • Detailed graph algorithms, including multiple max-flow/min-cut algorithms (Ford-Fulkerson, Edmonds-Karp, Dinic's), shortest path algorithms (Dijkstra, Bellman-Ford), and spanning tree algorithms (Kruskal, Prim).
  • Implementations for advanced topics like suffix arrays, Manacher's algorithm for palindromes, and Booth's algorithm for string rotation.
  • Includes complexity analysis (Big O notation) for most implementations.

Maintenance & Community

The repository is maintained by WilliamFiset, with contributions welcomed. There are links to forks in other languages (C++/Python, Rust).

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive for commercial and closed-source use. Attribution is appreciated but not required.

Limitations & Caveats

Some algorithms are marked as "[UNTESTED]". The primary implementation language is Java, though community forks exist for other languages.

Health Check
Last commit

7 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
284 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.