Algos
A Rust library with a collection of algorithms. Mostly intended as learning exercises for Rust.
Only sort, search and pattern matching algorithms for now. It is planned to add graph algorithms as well.
Usage
Add this to your Cargo.toml
:
[]
= "0.3"
and this to your crate root if on 2015 edition:
extern crate algos;
Sorts Algorithms
Add this to your crate root:
use sort;
and create an array and use like this:
main
It can also work in an array of Strings, sorting by the length of the string:
Search Algorithms
Add this to your crate root:
use search;
and create an array and use like this:
main
Pattern Matching algorithms
Add this to your crate root:
use pattern;
and use like this:
main
Implemented
Sorts
- Selection Sort
- Bubble Sort
- Cocktail Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
Searches
- Linear Search
- Binary Search
- Exponential Search
- Fibonacci Search
String Matching
- Bruteforce
- Karp-Rabin
- Boyer-Moore
- Horspool
- Quick
- Two-Way