Giter VIP home page Giter VIP logo

algorithms-1's Introduction

The Algorithms in C++

Codacy Badge Build status Build Status

These algorithms are the demonstration purposes only. There are many algorithms implementations in the C++ standard library that are much better for performance reasons. This project contains the following algorithms...

Allocators

Name allocator Allocation Free
Linear allocator O(1) -
Pool allocator O(1) O(1)

Caching

Name algorithm
First in, first out (FIFO)
Last recently used (LRU)

Computational geometry

Name algorithm Average result Worse result
Bresenham's line - -
Ramer-Douglas-Peucker O(n*log(n)) O(n^2)
Scan-line method O(n*log(n)) O(n*log(n))

Cryptography

Name algorithm
Caesar cipher

Data structures

Name structure Indexation Search Inserting Deleting Memory
Binary Heap - - O(log(n)) O(log(n)) O(n)
Binary Tree O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n)
LinkedList O(n) O(n) O(1) O(1) O(n)
Queue - - O(1) O(1) O(n)
Stack - - O(1) O(1) O(n)

Dynamic programming

Name algorithm
Exchange of coins
Fibonacci

Graphs

Name algorithm
Depth-First Search (DFS)
Breadth-First Search (BFS)

Multithreading

Name algorithm
Ping Pong
Producer and consumer

Search

Name algorithm Data Structure Average result Worse result
Binary search Sorted array O(log(n)) O(log(n))
Linear search Array O(n) O(n)

Set operations

Name algorithm
Difference between the ordered sets
Generation of all permutations from set
Generation of all subsets of the set
Intersection of the ordered sets
Symmetric difference of ordered sets
Union of the ordered sets

SmartPointers

Name pointer
Auto smart pointer
Unique smart pointer
Shared smart pointer

Sorting

Name algorithm Data Structure Best result Average result Worse result
Bubble sorting Array O(n) O(n^2) O(n^2)
Counting sorting Array O(n) O(n) O(n)
Insertion sorting Array O(n^2) O(n^2) O(n^2)
Merge sorting Array O(n*log(n)) O(n*log(n)) O(n*log(n))
Quick sorting Array O(n*log(n)) O(n*log(n)) O(n^2)
Selection sorting Array O(n) O(n^2) O(n^2)
Shell sorting Array O(n^2) O(n^2) O(n^2)
Stupid sorting Array O(n) O(n^3) O(n^3)

Others

Name algorithm
Queens puzzle
Maximum amound of subarrays
Reversal of the forward list
Tom Sawyer sence

Other algorithms will be added later. Please follow the news.

algorithms-1's People

Contributors

vladimirbalun avatar zegabr 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.