librualg 0.7.0

Collection of basic algorithms for everyday development
Documentation

Collection of basic algorithms for everyday development

Build Status Rust crates.io

LIst of algorithms:

Search algorithms:

  • Binary search

Segment Tree:

  • RSQ (Range Sum Query)
  • RMQMin (Range Minimum Query)
  • RMQMax (Range Maximum Query)
  • RMQMin (Range Minimum Query)

String Algorithms:

  • Knuth–Morris–Pratt string-searching algorithm (or KMP algorithm)

Combinatorics and enumeration algorithms

  • Permutation generation

Graph algorithms:

  • bfs (Breadth-First Search)
  • dfs (Depth-First Search)
  • dijkstra

Example

extern crate librualg;
use librualg::*;

fn main(){
    let seq = [1, 2, 3, 3, 4, 5];
    assert_eq!(binary_search::upper_bound(&seq, &3), Some(3));
}