This repository contains my implementations of useful algorithms for competitive programming in the Kotlin programming language. While the aim is for the algorithms to be as correct as possible, there might be a few mistakes. Therefore, none of these is algorithms is meant to be deployed in production. However, since accuracy is important, I'll try to write unit tests for each algorithm implemented.
Also, most of the code in this repo is meant to be used in programming competitions (such as codeforces, atcoder, google code jam e.t.c), so the emphasis is on keeping it as concise as possible, so some best practices are not followed and some functions may need to be modified to be useful in general cases.
Below are some resources I used to learn about the different algorithms in this repo:
- Competitive programmers handbook
- Algorithms text book by Robert Sedgewick
- CP algorithms site
- Various blog posts on codeforces
- String Hashing (Read more here)
- Rabin Karp Algorithm (Read more here and here)
- Key Indexed Counting a.k.a Counting sort (Read more in Section 5.1 of Algorithms and here)
- LSD and MSD Sort (Read more in Section 5.1 of Algorithms)
- Trie (Read more in Section 5.2 of Algorithms)
- Subsets and Permutations (Read more in Section 2.2 of Competitive Programmers Handbook)
- Next permutation (Read more here)