A collection of algorithm implementations covering fundamental computer science concepts. This project is designed as an educational resource for students learning algorithmic problem-solving through practical code examples.
Course: Algorithmics | Institution: School of Computer Science | University of Oviedo
- Java 25+ (project compiles with Java 25)
- Maven 3.6+ (tested with 3.9+, uses plugins requiring 3.6+)
- JUnit 5.10+ (managed automatically by Maven)
- Git (optional)
The project includes unit tests using JUnit.
# Clone the repository
git clone <repository-url>
cd algorithms
# Build the project
mvn clean compile
# Run all tests
mvn test
# Run a specific test class
mvn test -Dtest=YourTestClassName
# Run all tests with verbose output
mvn test -X
# Run tests for specific topic
mvn test -Dtest=sorting/*Test
# Run with coverage report (if configured)
mvn test jacoco:reportalgorithms/
βββ src/
β βββ main/java/topics/ # Algorithm implementations
β β βββ introduction/ # Getting started, recursion, search, data structures
β β β βββ examples/ # Java Collections examples (ArrayList, ArrayDeque, LinkedList, Stack, TreeSetβ¦)
β β βββ sorting/ # Sorting algorithms (Bubble, Mergesort, Quicksort, Heapsort, Radix, Shellβ¦)
β β β βββ utils/ # Shared sorting utilities & interface
β β βββ divideconquer/ # Divide & Conquer strategies
β β β βββ utils/ # Shared D&C utilities
β β βββ dynamic/ # Dynamic Programming
β β βββ greedy/ # Greedy Algorithms
β β β βββ agentsTasks/ # Agent-task assignment timing helpers
β β βββ backtracking/ # Backtracking techniques
β β β βββ times/ # Timing / benchmark helpers
β β βββ branchandbound/ # Branch & Bound methods
β β β βββ times/ # Timing / benchmark helpers
β β β βββ util/ # Core B&B framework (BranchAndBound, Heap, Nodeβ¦)
β β β βββ threads/ # Thread-safe B&B variants (BranchAndBoundThreads, HeapThreads, WorkerThread)
β β βββ parallel/ # Parallel algorithms (ForkJoin)
β βββ test/java/topics/ # Unit tests (JUnit 5)
βββ .github/ # GitHub configuration
β βββ workflows/ # CI/CD pipelines
β β βββ javadoc.yml # Publish Javadoc to GitHub Pages
β βββ ISSUE_TEMPLATE/ # Issue templates (bug report, feature request, custom)
β βββ java-upgrade/ # Java upgrade hooks
β βββ dependabot.yml # Dependabot version updates (Maven)
βββ .editorconfig # Editor formatting rules
βββ .gitignore # Git ignore patterns
βββ .vscode/ # VS Code workspace settings
βββ pom.xml # Maven configuration
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guidelines
βββ CHANGELOG.md # Release history
βββ CODE_OF_CONDUCT.md # Code of conduct
βββ SECURITY.md # Security policy
βββ LICENSE # MIT License
Main implementations:
- Array Summation
- Factorial Computation
- Foundational Arithmetic Engine
- Maximum Value Extraction
- MaxPairWiseProduct with 6 different implementations showing optimization progressions
- Random Dataset Generator
- Search (Algorithmic Structural Variations)
π Learn more: See Foundations of Algorithms
Main implementations:
- Bidirectional Bubble Sort (Cocktail Shaker Sort)
- Binary Insertion Sort
- Bubble Sort (Left-Bubbling)
- Bubble Sort (Optimized with Sentinel)
- Direct Insertion Sort
- Direct Selection Sort
- Heapsort
- Mergesort
- Quicksort (Median-of-Three)
- Radix Sort (LSD - Least Significant Digit)
- Shellsort
π Learn more: See Sorting Algorithms
Main implementations:
- Binary Search
- Factorial Calculation
- Fibonacci Sequence
- Greatest Common Divisor (GCD)
- Majoritarian Element
- Maximum Subarray Sum
- Median Calculation
- Mode Calculation
- Sequential (Linear) Search
- Vector Summation (Algorithmic Structural Variations)
π Learn more: See Divide and Conquer
Main implementations:
- 0/1 Knapsack
- Agent-Task Assignment
- Coin Change
- Disk Packing
- Fractional Knapsack
- Knight's Tour
- Knight's Tour (Warnsdorff's Heuristic)
- Multi-Plumber Scheduling
- Rapid Defense Assignment
- Single-Plumber Scheduling
π Learn more: See Greedy Algorithms
Main implementations:
- 0/1 Knapsack
- Cheaper Travel on the River
- Coin Change
- Combinations (n choose k)
- Fibonacci Sequence
π Learn more: See Dynamic Programming
Main implementations:
- Agent-Task Assignment
- Permutations Generation
- Subset Sum
- The Knight's Tour (All Solutions)
- The Knight's Tour (First Solution)
- The N-Queens (All Solutions)
- The N-Queens (First Solution)
π Learn more: See Backtracking
Main implementations:
- Task Assignment
- The 8-Puzzle
- Optimal Placement of Rectangles
- Optimal Placement of Rectangles (Concurrent Execution)
π Learn more: See Branch and Bound
Main implementations:
- Naive Recursive Fibonacci
- Parallel Array Transformation (Fork/Join)
- Parallel Array Squaring (Fork/Join)
- Parallel Array Summation (Fork/Join)
- Parallel Fibonacci (Fork/Join)
- Parallel File Processing (Fork/Join)
π Learn more: See Parallel Algorithms
- API Documentation: vicegd.github.io/algorithms/javadoc β Javadoc for all packages and classes in this repository
- Learn Algorithms: learnalgorithms.dev β In-depth explanations of the algorithms and related topics
To keep the repository organized and secure, our documentation is divided into the following files:
- π Contributing Guide: Coding standards and how to participate.
- π€ Code of Conduct: Guidelines for a healthy and welcoming educational environment.
- π‘οΈ Security Policy: Possible algorithmic vulnerabilities and how to report them.
- β±οΈ Changelog: Version history and the evolution of the codebase since 2015.
Vicente GarcΓa DΓaz
School of Computer Science
University of Oviedo
MIT License β Copyright (c) 2016 Vicente GarcΓa DΓaz
See LICENSE file for details