MCPcopy Index your code
hub / github.com/alexfertel/rust-algorithms

github.com/alexfertel/rust-algorithms @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,096 symbols 2,528 edges 160 files 235 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Classic Algorithms in Rust

This repo contains the implementation of various classic algorithms for educational purposes in Rust. It includes a comprehensive list of algorithms. Contributions are welcome!

The main goal right now is to improve docs, code readability and tests.

Setup

This repo is only for educational purposes. It is meant to be used as a reference material. Thus, it is written as a library instead of a binary.

The way to check the execution of an algorithm is running the tests, which you can do using:

cargo test

Sorting Algorithms

Graphs

Dynamic Programming

Data Structures

Strings

General

Ciphers

Bit Manipulation

Geometry

Search

Math

Contributing

See CONTRIBUTING.md

Extension points exported contracts — how you extend this code

Sorter (Interface)
(no doc) [20 implementers]
src/sorting/traits.rs
Hashable (Interface)
A trait for types that can be hashed. [1 implementers]
src/data_structures/hashtable.rs
Graph (Interface)
(no doc) [2 implementers]
src/data_structures/graph.rs

Core symbols most depended-on inside this repo

len
called by 199
src/data_structures/stack.rs
push
called by 186
src/data_structures/stack.rs
insert
called by 116
src/data_structures/rope.rs
iter
called by 91
src/data_structures/rb_tree.rs
add_edge
called by 62
src/graphs/prim.rs
add_edge
called by 29
src/graphs/bellman_ford.rs
cmp
called by 27
src/general/huffman_encoding.rs
add_edge
called by 24
src/graphs/dinic_maxflow.rs

Shape

Function 742
Method 248
Class 96
Enum 7
Interface 3

Languages

Rust100%

Modules by API surface

src/data_structures/avl_tree.rs31 symbols
src/data_structures/linked_list.rs25 symbols
src/data_structures/rope.rs23 symbols
src/data_structures/stack_using_singly_linked_list.rs22 symbols
src/ciphers/aes.rs22 symbols
src/data_structures/graph.rs21 symbols
src/data_structures/rb_tree.rs19 symbols
src/data_structures/binary_search_tree.rs19 symbols
src/bit_manipulation/basic.rs18 symbols
src/math/fast_fourier_transform.rs17 symbols
src/general/huffman_encoding.rs17 symbols
src/data_structures/heap.rs17 symbols

For agents

$ claude mcp add rust-algorithms \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact