Giter VIP home page Giter VIP logo

combinatoric-sample's Introduction

Combinatoric sample

What is it?

It's just a little project made to show the (big) differences between some kind of algorithms and the importance to wisely choose them.

Algorithm type currently in use : Recursion Memoization Dynamic

Problem

Input : The different values you can use. The amount you want to reach with the differents values.

Output : The count of the different ways to reach the amount with the values.

Result

1st example

Values = [ 2, 3, 4, 1, 6, 8, 7, 9, 12, 15 ] Amount = 15 Output : 120 ways to reach 15 with the values [ 2, 3, 4, 1, 6, 8, 7, 9, 12, 15 ] Performance : * Recursion : 0 ms, 757 ticks, 224 octets * Memoization : 0 ms, 1456 ticks, 3548 octets. * Dynamic : 0 ms, 954 ticks, 382 octets.

2nd example

Values = [ 2, 3, 4, 1, 6, 8, 7, 9, 12, 15 ] Amount = 100 Output : 2550451 ways to reach 100 with the values [ 2, 3, 4, 1, 6, 8, 7, 9, 12, 15 ] Performance : * Recursion : 1402 ms, 4371799 ticks, 224 octets * Memoization : 0 ms, 2360 ticks, 31386 octets. * Dynamic : 0 ms, 1327 ticks, 1062 octets.

3rd example

Values = [ 2, 3, 4, 1, 6, 8, 7, 9, 12, 15 ] Amount = 150 Output : 47022867 ways to reach 150 with the values [ 2, 3, 4, 1, 6, 8, 7, 9, 12, 15 ] Performance : * Recursion : 33948 ms, 105831900 ticks, 224 octets * Memoization : 0 ms, 2603 ticks, 31912 octets. * Dynamic : 0 ms, 1829 ticks, 1462 octets.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.