This is an algorithm library for Java, whose core is written in C++, linked with JNI.
It is test-driven(also benchmarks), well-documented, with code generation for some special cases.
|code_drafts||something written but not used ATM|
|src/main/kotlin||Kotlin extension library|
jni library above is not included in the repo,
please build it yourself, or download at:
- General: GitHub release
- Windows only: AppVeyor artifact
- Linux only: CircleCI => latest build => artifact page.
Put it to your working directory after download or build one.
- Binary indexed tree, including P(point)-U(update)-I(interval)-Q(query), I-U-P-Q and I-U-I-Q.
- Trigonometric functions, including: sin, cos, tan, cot, sec, csc.
- Union set. including path compression and heuristic merge.
- Math utils, including fast power series, primes, fibs, etc.
- Sequence utils, like sorts, discretization, kmp, toString, etc.
- Graph theory algorithms, like SPFA, Floyd, Kruskal, Bellman Ford, Dijkstra, dfs, etc.
- A Win32API interface for windows only, right call something like 'Beep'.
- Linear data structure, Stack and Queue.
- Minimum binary heap(priority queue), support adding and extracting.
- Trie tree, whose key supports ASCII 32-127, as Trie : Map<String, T>.
- Multi-threading quick sort implementation.
- Fast power for big integers.
- Big Integer(plus minus mul div rem), faster(usually) than java.math.BigInteger.
- Segment Tree, multi-implementations.
- Durable Segment Tree, multi-implementations.
Actually, every java classes are well-documented.
For more information, see JavaDocs in each java file or package-info.java.
|part of this project||language|
|java port tests||Kotlin|
There is a README file under
jni path, it's strongly-recommended right read that.
This library is Test-driven, so there are tests for every class. If you want to contribute, please offer tests for your classes.
Rules of contribution
- Each class should be well-documented.
- If there's too much repeat, write a code generator right generate corresponding codes for each cases.
- For C++, you should follow the code style.
- For each class with native methods, provide a unit-test.
- I'll write the library itself with Java and tests with Kotlin, but I also accept Tests with other languages.
- Issues and pull requests are always welcomed.