/rust-algorithms

Algorithms and Data Structures of all kinds written in Rust.

Primary LanguageRust

Classic Algorithms in Rust

This repo contains the implementation of various classic algorithms for educational purposes in Rust. Right now, it is in its early stages, but the plan is to include a comprehensive list of algorithms. Contributions are welcome!

The main goal right now is to match the current algorithms implemented in https://github.com/TheAlgorithms/Rust.

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

Algorithms

Sorting Algorithms

  • Bubble
  • Counting
  • Heap
  • Insertion
  • Merge
  • Quick
  • Radix
  • Selection
  • Shell

Graphs

  • Dijkstra
  • Kruskal's Minimum Spanning Tree
  • Prim's Minimum Spanning Tree
  • BFS
  • DFS

Dynamic Programming

  • 0-1 Knapsack
  • Edit Distance
  • Longest common subsequence
  • Longest increasing subsequence
  • K-Means Clustering
  • Coin Change
  • Rod cutting
  • Egg Dropping Puzzle

Data Structures

  • Queue
  • Stack
  • Heap
  • Linked List
  • Graph
  • Trie
  • Binary Search Tree
  • B-Tree
  • AVL Tree

String Matching

  • Naive
  • Rabin Carp
  • Finite Automaton
  • Knuth Morris Pratt
  • Reversing text

General

  • Convex Hull: Graham Scan
  • N-Queens
  • Graph Coloring
  • Tower of Hanoi

Ciphers

  • Transposition
  • Caesar cipher
  • ROT13
  • Vigenere
  • Morse

Bit Manipulation

  • Bit Distance
  • Bits Length
  • Clear Bit
  • Count Ones
  • Divide By Two
  • Get Bit
  • Is Even
  • Is Positive
  • Is Power Of Two
  • Multiply By Two
  • Multiply Signed
  • Multiply Unsigned
  • Set Bit
  • Twos Complement
  • Update Bit

Contributing

See CONTRIBUTING.md