AlgoPlus
AlgoPlus copied to clipboard
AlgoPlus is a C++17 library for complex data structures and algorithms
Algoplus{BETA Version}
AlgoPlus is a C++ library that includes ready-to-use complex data structures and algorithms.
See the full documentation here
Join our Discord
Example:
#include <graph.h>
graph<std::string> g("undirected");
g.add_edge("hello", "world");
g.add_edge("world", "universe");
g.add_edge("hello", "universe");
if(g.connected()){
std::cout << "graph is connected" << '\n';
}
#include <graph.h>
weighted_graph<int> g("undirected");
g.add_edge(1, 4, 2);
g.add_edge(4, 5, 6);
g.add_edge(5, 2, 9);
g.add_edge(2, 8, 10);
// returns the shortest path from 1 to 2.
std::cout << g.shortest_path(1, 2) << '\n';
g.visualize() // You can visualize almost any of our implemented data structures!
You can see more examples or follow the Tutorials.
Classes
Graphs
Trees
- [X] AVL Tree
- [X] Binary Search Tree
- [X] Splay Tree
- [X] Trie
- [X] Interval Tree
- [X] Min/Max Heap
Lists
- [X] Single Linked List
- [X] Doubly Linked List
- [X] Circular Linked List
- [X] Skip List
Other
- [X] Disjoint set
- [X] Stack
- [X] Queue
- [X] Hash Table
Machine Learning(NEW!)
- [X] Kmeans
- [X] DBSCAN
- [X] Linear Regression
- [X] Huffman Coding
- [X] Polynomial Regression
How to run test cases
We have unit tests for every function of our implemented algorithms & data structures.It is very important to make sure that your code works before making any pull requests!
Linux/MacOS
mkdir build && cd build
cmake ..
make
cd tests
./runUnitTests
Windows
mkdir build && cd build
cmake -G "MinGW Makefiles" ..
make
cd tests
./runUnitTests
Our contributors
How to contribute
-
Povide new implementations on our already implemented data structures & algorithms.
-
Implement new classes / algorithms.
-
Contribute to unit testing by writting unit tests for our classes and algorithms.
-
Create and contribute to APIs for other languages.
-
Promote the repository on your local workshop/seminar and get a shout-out.
See more here.