Skip to content

๐ŸŽ“ Different algorithms and problems implemented in C++

Notifications You must be signed in to change notification settings

Jollu8/Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

81 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

The Algorithms in C++

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

Allocator

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
RSA
Diffie-Hellman
Data Encryption Standard
Blow Fish
Triple DES
RC4

Data structures

Name structure Indexation Search Inserting Deleting Memory
Binary Heap - - O(log(n)) O(log(n)) O(n)
AVL tree - O(log n) O(log n) O(log n) 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)
Ternary Searching Array O(n) (On)

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
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)
Quick recursive Sorting Array O(n*log(n)) O(n*log(n)) O(n*log(n))

Differences

Name algorithm
Euclidean algorithm
Eratosthenes sieve
Queens puzzle
Maximum amount of subArrays
Reversal of the forward list
Tom Sawyer sense

About

๐ŸŽ“ Different algorithms and problems implemented in C++

Resources

Stars

Watchers

Forks

Packages

No packages published