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...
Name allocator | Allocation | Free |
---|---|---|
Linear allocator | O(1) | - |
Standard allocator | O(1) | - |
Name algorithm |
---|
Caesar cipher |
Hex |
Crypto random + entropy |
RC4 cipher |
Name structure | Indexation | Search | Inserting | Deleting | Memory |
---|---|---|---|---|---|
Circular buffer | O(n) | O(n) | O(1) | O(1) | O(n) |
Linked list | O(n) | O(n) | O(1) | O(1) | O(n) |
XOR Linked list | O(n) | O(n) | O(1) | O(1) | O(n) |
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) |
Name algorithm |
---|
Difference between 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 |
Union of the ordered sets w doubles |
Name pointer |
---|
Shared smart pointer |
Unique smart pointer |
Name algorithm | Data Structure | Best result | Average result | Worse result |
---|---|---|---|---|
Bubble sorting | Array | O(n) | O(n^2) | O(n^2) |
Bucket sorting | Array | O(n) | O(n) | 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)) |
Move elements to left | Array | O(n) | O(n) | O(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) |
Name algorithm |
---|
Fibonacci |
Reversal forward list |
Reverse matrix diagonals |
Rotate matrix |
Name templates |
---|
Copy string |
Number to string 32 bits |