This project is focused on implementing algorithms and data structures in C++, while following good software engineering practices, such as:
- Writing well-documented code
- Adhering to code guidelines
- Writing and passing unit tests
- Reviewing each other's code
- Implement algorithms and data structures
- Learn to be better software developers
- Guide one another on version control, unit testing, and algorithms
There are a few ways to get involved.
- Read the contribution guidelines
- Fork the repo
- Create an issue describing what you'd like to add, or claim an issue that's up for grabs
- Create a branch and add your code
- Submit a pull request and reference the issue it closes
You can find more details regarding the steps above in the contribution guidelines, so be sure to check them out.
Create a new issue and we'll handle it from there. π
β = has unit tests
-
Backtracking
- N-Queens β
-
Dynamic programming
- 0-1 knapsack β
- Coin change β
- Longest decreasing subsequence β
- Matrix chain multiplication β
- Maximum sum contiguous subarray: Kadane's algorithm β
- Rod cutting β
- Weighted activity selection β
-
Number theory
- Binomial coefficient β
- Euclidean algorithms
- Greatest common divisor (GCD) β
- Extended Euclidean algorithm (BΓ©zout coefficients) β
- Fast exponentiation β
- Nth Fibonacci number
- Perfect number check β
- Prime numbers
-
Searching
- Binary search β
- Linear search β
- Ternary search β
-
Sorting
- Bubble sort β
- Bucket sort β
- Comb sort β
- Counting sort (stable) β
- Heap sort β
- Insertion sort β
- Merge sort β
- Quick sort β
- Radix sort
- Selection sort β
- Shell sort β
-
String
- Longest common subsequence β
- Searching (pattern matching)
- Edit Distance Problem β
- Shunting yard β
- Permutation
-
Linked List
-
Queue
- Queue β
-
Set
- Disjoint-set β
-
Stack
- Stack β
-
Tree
To compile the source files, run make
from the C++
directory. Doing so will create executable binaries in the bin
directory.
To compile and run all tests, run make test
. This will compile all the tests (in the same way as described above) and will run them, displaying the results.
In order to run a specific test and see its results, run it manually from the bin
directory after calling make
. For example, this command (executed from bin
) would run only the unit tests for the N Queens algorithm:
$ ./n_queens
To remove all of the files created during compilation, run make clean
. You need not do this every time you make some changes to a file and want to recompile it. Just run make
and it will re-compile just those files whose contents have changed.
To see what happens in the background during compilation and testing, see the following files:
For more information on make
, see the GNU make Manual. For more information on CMake
, see the CMake Tutorial.
This project is actively maintained by @alxmjo, and inactively by @faheel.
This project is licensed under the terms of the MIT license.