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 21+ (project compiles with Java 21)
- Maven 3.6+ (tested with 3.9+, uses plugins requiring 3.6+)
- JUnit 5.10.2 (managed automatically by Maven)
- Git (optional)
# 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=YourTestClassNamealgorithms/
βββ src/
β βββ main/java/topics/ # Algorithm implementations
β β βββ introduction/ # Getting started, recursion, search, data structures
β β β βββ examples/ # Java Collections examples (ArrayList, Stack, TreeSetβ¦)
β β βββ sorting/ # Sorting algorithms
β β β βββ others/ # Additional sorts (Heapsort, Radix, Shell, Bidirectionalβ¦)
β β β βββ 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 (Heap, Nodeβ¦)
β β β βββ threads/ # Thread-safe B&B variants
β β βββ 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
βββ .editorconfig # Editor formatting rules
βββ .gitignore # Git ignore patterns
βββ pom.xml # Maven configuration
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guidelines
βββ CHANGELOG.md # Release history
βββ LICENSE # MIT License
Main implementations:
- Array Summation
- Factorial Computation
- Foundational Arithmetic Engine
- Maximum Value Extraction
- MaxPairWiseProduct problem with 6 different implementations showing optimization progressions
- Random Dataset Generator
- Search Algorithms
π Learn more: See Foundations of Algorithms
Main implementations:
- Bidirectional Bubble Sort (Cocktail Shaker Sort)
- Binary Insertion Sort Algorithm
- Bubble Sort Algorithm (Left-Bubbling)
- Bubble Sort Algorithm (Optimized with Sentinel)
- Direct Insertion Sort Algorithm
- Direct Selection Sort Algorithm
- Heapsort Algorithm
- Mergesort Algorithm
- Quicksort Algorithm (Median-of-Three)
- Radix Sort Algorithm (LSD - Least Significant Digit)
- Shellsort Algorithm
π Learn more: See Sorting Algorithms
Main implementations:
- Searching: Binary Search
- Mathematical: Fibonacci, Factorial, GCD
- Array Operations: Vector Sum, Mergesort, Quicksort
- Statistical: Median, Mode, Majoritarian Element, Max Sum
π Learn more: See Divide and Conquer
Main implementations:
- Coin Change (Optimal vs Non-Optimal)
- Knapsack Problem variants
- File Disk Optimization
- Agent Task Assignment
- Chess Horse Movement
π Learn more: See Greedy Algorithms
Main implementations:
- Fibonacci Sequence
- 0/1 Knapsack Problem
- Coin Change Problem
- Combinations/Permutations
- River Travel Optimization
π Learn more: See Dynamic Programming
Main implementations:
- Permutations Generation
- Subset Sum Problem
- The Knight's Tour Problem (All Solutions)
- The Knight's Tour Problem (First Solution)
- The N-Queens Problem (All Solutions)
- The N-Queens Problem (First Solution)
π Learn more: See Backtracking
Main implementations:
- Task Assignment Problem
- The 8-Puzzle Problem
- 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
The project includes comprehensive unit tests using JUnit 5.
# 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:report- API Documentation: vicegd.github.io/algorithms β 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