.gemini.md
This repository contains a collection of common data structures and algorithms implemented in Java, with a focus on simplicity and elegance.
datastructures, graphtheory, dp).MODULE.bazel using rules_jvm_external. Key dependencies include JUnit 5, Guava, and Mockito.Bazel is the primary build system. Each package contains a BUILD file defining libraries and binaries.
Run an algorithm:
bazel run //src/main/java/com/williamfiset/algorithms/<subpackage>:<ClassName>
Example: bazel run //src/main/java/com/williamfiset/algorithms/search:BinarySearch
Run all tests:
bazel test //src/test/...
Run tests for a specific package:
bazel test //src/test/java/com/williamfiset/algorithms/<subpackage>:all
Run a specific test class:
bazel test //src/test/java/com/williamfiset/algorithms/<subpackage>:<TestClassName>
If Bazel is not available, you can compile and run manually:
mkdir -p classes
javac -sourcepath src/main/java -d classes src/main/java/com/williamfiset/algorithms/<path>/<File>.java
java -cp classes com.williamfiset.algorithms.<package>.<ClassName>
src/main/java/com/williamfiset/algorithms/: Implementation source code.src/test/java/com/williamfiset/algorithms/: Unit tests (mirrors source structure).utils/: Contains helper classes like GraphGenerator and graph Utils..java file to the appropriate package in src/main/java/....java_library's srcs in the package's BUILD file (usually handled by glob).java_binary target for the class if it has a main method.src/test/java/....java_test target in the test directory's BUILD file.README.md with a link to the new implementation and its complexity.solve() or specific getter method.List<List<Edge>> or List<List<Integer>>.NetworkFlowSolverBase.README.md: Comprehensive list of all implemented algorithms and data structures.MODULE.bazel: Defines external dependencies and Bazel module configuration.CLAUDE.md: Additional technical guidance for AI assistants.BUILD.bazel / BUILD: Bazel build definitions.