Skip to content

vicegd/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

307 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Algorithms: An Educational Repository

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


πŸš€ Quick Start

Prerequisites

  • 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)

Installation, Setup & Testing

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:report

Project Structure

algorithms/
β”œβ”€β”€ 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

πŸ“š Core Topics & Algorithms

1. Foundations of Algorithms

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


2. Sorting 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


3. Divide & Conquer

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


4. Greedy Algorithms

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


5. Dynamic Programming

Main implementations:

  • 0/1 Knapsack
  • Cheaper Travel on the River
  • Coin Change
  • Combinations (n choose k)
  • Fibonacci Sequence

πŸ“– Learn more: See Dynamic Programming


6. Backtracking

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


7. Branch & Bound

Main implementations:

  • Task Assignment
  • The 8-Puzzle
  • Optimal Placement of Rectangles
  • Optimal Placement of Rectangles (Concurrent Execution)

πŸ“– Learn more: See Branch and Bound


8. Parallel Algorithms

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


πŸ“– Additional Resources


πŸ“š Documentation & Resources

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.

πŸ‘¨β€πŸ’Ό Author

Vicente GarcΓ­a DΓ­az
School of Computer Science
University of Oviedo


πŸ“œ License

MIT License β€” Copyright (c) 2016 Vicente GarcΓ­a DΓ­az
See LICENSE file for details

About

This repository contains example algorithms initially designed for the Algorithmics course taught at the School of Computer Science, University of Oviedo.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages