datas-and-algos is free Software under the terms of the GNU General Public License Version 2. See COPYING for full license text.
Some data structures and algorithms I have implemented for fun, including unit tests.
- al/mergesort.h
Mergesort - al/sort-and-count-inversions.h
Inplace sort, returns the count of inversions - al/strassen-matrix-multiply.h
Matrix multiplication as invented by Strassen - al/radixsort.h
LSD Radixsort - al/murmur.h
MurmurHash 32bit/128bit as invented by Austin Appleby - al/counting-sort.h
Counting Sort - al/boyer-moore-substring.h
Boyer-Moore String Search
- ds/square-matrix.h
A square matrix utilisingstrassen-matrix-multiply.h
- ds/stack.h
A stack - ds/binary-search-tree.h
A binary search tree - ds/fixed-hashtable.h
A hashtable with fixed size.al::murmur_32
is used as a hash function. - ds/priority-queue.h
A priority queue based onstd::make_heap
,std::push_heap
andstd::pop_heap
- ds/bloom-filter.h
Bloom filter,al::murmur_128
is used as a hash function.
- src/al/
Algorithms - src/ds/
Data structures - test/src/al/
Unit tests for algorithms - test/src/ds/
Unit tests for data structures - test/src/generic/
Generic unit tests (rule-of-five.h
, useful for default constructible objects that implement the rule of five) - test/smhasher/
SMHasher build to verify my MurmurHash (32bit, 128bit) implementation. Will automatically download SMHasher from Google Code. - scripts/
Helper scripts (build.sh
,build-and-run-tests.sh
, ...) - scripts/static-analysis/
Convenience wrappers for cppcheck and cpplint (run_cppcheck.sh
,run_cpplint.sh
)
Either use the convenience script in scripts/build-and-run-tests.sh
or use cmake directly:
cd test/build
cmake ..
make
./datas-and-algos-test
The unit testing framework (googletest) will automatically be downloaded and built by cmake.
cmake >= 2.8.7, boost (boost::optional
for ds::fixed_hashtable
)