Algorithms

cat-algorithms

Rust implementations of core algorithms, such as hashing, sorting (e.g., merge sort, quicksort), searching, and more.

The following table denotes the most common crates used for each algorithm category.

TopicRust CratesNotes
Sortingstd::cmp, itertools, randstd::cmp provides ordering traits, itertools for iterators, rand for generating test data. No single crate is the sorting crate, as std::slice::sort is often sufficient.
Searchingstd::cmpBinary search is available in the standard library.
Data Structures (General)std::collections, im, petgraphstd::collections for common structures (Vec, HashMap, etc.), im for immutable data structures, petgraph for graphs.
Graph Algorithmspetgraph, pathfindingpetgraph is a popular graph library. pathfinding provides pathfinding algorithms.
Dynamic ProgrammingOften implemented without external cratesDP is often implemented using standard library features like vectors and iterators.
String Algorithmsregex, aho-corasick, strsimregex for regular expressions, aho-corasick for multiple pattern searching, strsim for string similarity.
Numerical Algorithmsnalgebra, ndarray, numnalgebra for linear algebra, ndarray for N-dimensional arrays, num for numeric traits.
Cryptographyring, rust-crypto, sha2Several crates exist; choose carefully based on security needs and audit history.

Random Numbers

Sorting

TopicRelated Links
Compression
CryptographyCryptography Utilities, Encryption, Hashing, Password Hashing
Data Processing
Data StructuresConcurrent Data Structures
MathematicsAdditional Numeric Types, Complex Numbers, Linear Algebra, Statistics, Trigonometry.
ScienceMachine Learning, Geoscience, Neuroscience, Science Robotics, Simulation
SearchSearch Engines
StringsString Concat, String Encoding, String Parsing, Text Processing