SamLeach / ProjectEuler

Mathematical Algorithms with Project Euler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mathematical Algorithms with Project Euler

This project attempts to document the algorithm discovery and optimisation phases carried out while solving Project Euler mathematical problems programmatically. Its purpose is not to document the best algorithms or solutions but to document the progression from brute force solutions to better and better algorithms.

Usage

Each commit will show progression of some sort, adding a new solution or optimising an existing solution. It's very interesting to see how the algorithms transform.

Implementations

There are 4 implementations for each problem:

  1. BruteForce
  2. Linq
  3. Optimised
  4. ProjectEuler

Each implement ISolutions.

The solutions can be ran from the test project. There is a test class for each of the 4 implementations.

Brute Force

Here are naive and brute force solutions. It is interesting to see how the algorithms change as they are optimised so I have kept the brute force versions here for comparison and learning.

Linq

The other solutions cannot leverage Linq. These solutions can use Linq.

Optimised

These solutions are optimised. I tried to optimise as well as I could without cheating by getting help from the internet. If I look something up I will document it.

Project Euler

These solutions are a C# implementation of the answers that Project Euler provides once you complete a problem. Used to compare with my own optimised solutions.

About

Mathematical Algorithms with Project Euler


Languages

Language:C# 100.0%