Collection of basic algorithms for everyday development
LIst of algorithms:
Search algorithms:
- Binary search
- Bloom Filter
- Binary Tree
Segment Tree:
- RSQ (Range Sum Query)
- RMQMin (Range Minimum Query)
- RMQMax (Range Maximum Query)
- RMQMin (Range Minimum Query)
Sparse Tables:
- SparseTableMin (Range Minimum Queries)
- SparseTableMax (Range Maximum Queries)
String Algorithms:
- Knuth–Morris–Pratt string-searching algorithm (or KMP algorithm)
- Trie or prefix tree
- Levenshtein distance (Metric of the difference between two symbol sequences)
- Search for the minimum string period
- Search distinct substrings
- Suffix Array
- The Longest Common Prefix
- Search for a common substring (hashing)
- Algorithm Aho Corasick. Search for a set of substring from the dictionary in the given string.
Combinatorics and enumeration algorithms
- Permutation generation
Graph algorithms:
- bfs (Breadth-First Search)
- dfs (Depth-First Search)
- dijkstra
- connected components
- strongly connected components
Mathematics algorithms:
- The Greatest Common Divisor (GCD)
- Fast pow
- Fast pow by module
- Checking a Number for Simplicity (Fermat's test)
Data compression:
- Huffman algorithm
Example
extern crate librualg;
use *;