Rusty Algorithms and Data Structures for Education & Leetcode Solutions

Crates.io Crates.io Crates.io Continuous Integration Coverage Status lines of code

This repository presents Rust implementations of common algorithms and data structures, most of which are based on William Fiset's Java implementation: https://github.com/williamfiset/Algorithms . I highly recommend his YouTube channel, where he explains many of these algorithms in detail using illustrations, animations and pseudocode.

In addition to implementing W. Fiset's algorithms, I also write solutions to competitive programming problems. Some representative problems are explained in src/problems, and there is also a leetcode folder for my leetcode solutions. Both are far from completion.

Usage

The implementation details are explained in comments and docs and the example usage is implied in unit tests. To run tests:

cargo test

I use LaTeX to write some math expression in docs. To render them correctly in docs, run:

RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps --open

or an alias for this command:

./doc

Recommended Environment

This simple setup provides most features a decent IDE would provide (importantly, jump to definition and type labelling)

Contents

Graph

Graph Representations

Fundamental Graph Algorithms

Tree Algorithms

Minimum Spanning Tree/Forest

Network Flow

Shortest Path

Others

Data Structures

Machine Learning

Clustering

Math

Problems

Dynamic Programming

Back Tracking

Graph

Network Flow