The Algorithms - Rust
repository·master·Indexed 12 days ago
https://github.com/thealgorithms/rustAn educational collection of algorithm implementations in Rust, version 0.1.0, designed to help developers learn algorithmic concepts. The repository includes implementations of ciphers (AES, SHA-2, Caesar), data structures (B-Trees, AVL Trees, Doubly Linked Lists), searching algorithms (Binary, Exponential, Fibonacci), sorting algorithms (Timsort, Quick Sort, Merge Sort), and string algorithms (Aho-Corasick, KMP, Burrows-Wheeler transform).
What's inside The Algorithms - Rust
- The Algorithms - Rust is an educational repository containing various algorithms implemented in the Rust programming language. It is designed to serve as a learning resource for developers interested in understanding algorithmic logic through Rust implementations.
Overview of Sort Algorithms
masterThis module provides a collection of various sorting algorithm implementations in Rust. The algorithms range from simple educational examples like Bogo-sort to efficient, production-grade hybrid algorithms like Timsort. Each algorithm is implemented in its own module within thesrc/sorting/directory.Explore Compression algorithms
masterThe
compressionmodule includes several data compression techniques:Burrows-Wheeler TransformHuffman EncodingLZ77Move to FrontRun Length EncodingPeak Signal-to-Noise Ratio(Metric)
Use String Algorithms in Rust
masterThe
the_algorithms_rustrepository provides implementations of various string-based algorithms. You can use these to perform tasks such as dictionary matching, pattern searching, compression, and calculating string metrics.Available algorithms include:
- Aho-Corasick: Dictionary-matching for locating multiple strings simultaneously.
- Burrows-Wheeler transform: Reorganizes strings into runs of similar characters for compression.
- Knuth Morris Pratt (KMP): Linear-time pattern searching.
- Manacher: Finding the longest palindromic substring in linear time.
- Rabin Karp: Hashing-based pattern searching.
- Hamming Distance: Measuring the number of substitutions required to transform one string into another (requires equal length strings).
- Run Length Encoding: Lossless data compression by storing sequences of identical data as a value and a count.
Explore Data Structures
masterThe
data_structuresmodule contains various fundamental data structures and probabilistic structures:- Trees:
AVL Tree,B-Tree,Binary Search Tree,Fenwick Tree,Lazy Segment Tree,RB Tree,Segment Tree,Segment Tree Recursive,Treap,Trie,Veb Tree - Linear/Other:
Graph,Hash Table,Heap,Linked List,Queue,Stack Using Singly Linked List,Union Find - Probabilistic:
Bloom Filter,Count Min Sketch - Specialized:
Floyds Algorithm,Range Minimum Query
- Trees:
Explore Searching algorithms
masterThe repository includes several searching techniques:
- Standard Search: Binary Search (Iterative & Recursive), Linear Search, Exponential Search, Jump Search, Interpolation Search, Ternary Search.
- Specialized Search: Fibonacci Search, Saddleback Search, Quick Select, K-th Smallest (including Heap-based implementation).
- Other: Moore Voting.
Explore Bit Manipulation algorithms
masterThe
bit_manipulationmodule contains various low-level bitwise operations and algorithms, such as:- Bit Counting/Finding:
Counting Bits,Highest Set Bit,Rightmost Set Bit,Trailing Zeros - Properties:
Is Power of Two,Hamming Distance,Unique Number - Transformations:
Binary Coded Decimal,Binary Shifts,N Bits Gray Code,Reverse Bits,Swap Odd and Even Bits,Two's Complement - Arithmetic:
Sum of Two Integers - Other:
Missing Number,Previous Power of Two
- Bit Counting/Finding:
Explore Big Integer algorithms
masterThe
big_integermodule provides algorithms for handling large integer operations, including:Fast FactorialMultiplyPoly1305
Explore Backtracking algorithms
masterThe repository contains several implementations of backtracking algorithms. You can find specific implementations for tasks such as:
- Combinations:
All Combinations of Size K - Graph Problems:
Graph Coloring,Hamiltonian Cycle,N-Queens - Puzzles/Games:
Knight Tour,Sudoku,Rat in Maze - Mathematical/Logic:
Parentheses Generator,Permutations,Subset Sum
- Combinations:
Explore Conversions
masterThe
conversionsmodule provides utilities for converting between different number systems, units, and formats:- Number Systems: Binary, Decimal, Hexadecimal, Octal, Roman Numerals
- Physical Units: Energy, Length, Pressure, Speed, Temperature, Volume, Weight
- Color/Coordinate: RGB-CMYK, RGB-HSV, Rectangular to Polar
- Other: IPv4, Order of Magnitude, Time
Explore Navigation and Number Theory algorithms
masterAdditional specialized algorithm categories available:
Navigation:
- Bearing
- Haversine
- Rhumbline
Number Theory:
- Compute Totient
- Euler Totient
- K-th Factor
Explore Dynamic Programming
masterThe
dynamic_programmingmodule contains algorithms solved using dynamic programming techniques, such as:Catalan Numbers