Git Product home page Git Product logo

algorithms's Introduction

Algorithms

Algorithms stuff created on my own, grabbed from some resources and all of them are putted here.

Methodology

This repository of ready-to-use algorithms follows a methodology that makes algorithms easy to find, extend and copy to your existing code. Every algorithm that is here needs to be:

  • In separated file need to work sreperatly, without using any sources or algorithms from another one.
  • Easy to copy and paste into your own code.
  • Is supposed to be fast, not necessarily readable

Note
Usefull for creating memory-efficent algorithms are sizes of each types in C++, they are listed in sizes file

Tasks

List of currently implemented algorithms:

  • Prefix sums Answers: O(1)

    • 2d sums O(n * m)
    • Normal sums O(n)
    • Sums on overlapping intervals O(n)
  • Math

    • Is a prime number O(sqrt2(n))
    • Euklides NWD O(log2(max(n, k)))
    • Euklides NWW O(log2(max(n, k)))
    • Advenced euklides O(log2(max(n, k)))
    • The sieve of Eratosthenes O(n log2(log2(n)))
    • Number of dividers
    • Remembered factorial
    • Permutations
  • Trees O(log2(n))

    • Range-Range Tree
    • Point-to-Range Tree
    • Range-to-Point Tree
  • Graphs

    • Dijkstra algorithm O(m log2(n))
    • BFS for:
      • Graph O(n+m)
      • Grid O(n*m)
    • DFS for:
      • Graph: O(n+m)
      • Grid O(n*m)
  • Sparses

    • Range Minimum Queries O(n log n) O(1)
    • Range Sum Queries (is simmilar to prefix sums but much slower)
  • Other

    • Caterpillar algorithm O(2 * n)
    • Merge sort O(n log n)
    • Binary Search O(log2(n))
    • Bubble sort O(n^2)

Credits

Thanks for help from various internet sources including software engineering forums and CpAlgorithms

algorithms's People

Contributors

mondonno avatar

Stargazers

 avatar

Watchers

 avatar

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.