{"id":26489564,"url":"https://github.com/alexfertel/rust-algorithms","last_synced_at":"2025-04-12T06:10:48.929Z","repository":{"id":39905042,"uuid":"382975606","full_name":"alexfertel/rust-algorithms","owner":"alexfertel","description":"Algorithms and Data Structures of all kinds written in Rust.","archived":false,"fork":false,"pushed_at":"2024-10-09T10:23:50.000Z","size":474,"stargazers_count":206,"open_issues_count":3,"forks_count":76,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T04:41:13.337Z","etag":null,"topics":["algorithms","data-structures","graph","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexfertel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-05T00:37:44.000Z","updated_at":"2025-03-18T08:15:42.000Z","dependencies_parsed_at":"2023-01-31T06:31:00.918Z","dependency_job_id":"295610ce-f9db-4e17-bcd9-fb4ded46168b","html_url":"https://github.com/alexfertel/rust-algorithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfertel%2Frust-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfertel%2Frust-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfertel%2Frust-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfertel%2Frust-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexfertel","download_url":"https://codeload.github.com/alexfertel/rust-algorithms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525138,"owners_count":21118619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","data-structures","graph","rust"],"created_at":"2025-03-20T07:41:53.335Z","updated_at":"2025-04-12T06:10:48.911Z","avatar_url":"https://github.com/alexfertel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Classic Algorithms in Rust\n\nThis repo contains the implementation of various classic algorithms for\neducational purposes in [Rust](https://www.rust-lang.org/). It includes a\ncomprehensive list of algorithms. Contributions are welcome!\n\nThe main goal right now is to improve docs, code readability and tests.\n\n## Setup\n\nThis repo is only for educational purposes. It is meant to be used as a\nreference material. Thus, it is written as a library instead of a binary.\n\nThe way to check the execution of an algorithm is running the tests, which you\ncan do using:\n\n```bash\ncargo test\n```\n\n---\n\n### Sorting Algorithms\n\n- [x] [Bingo](./src/sorting/bingo_sort.rs)\n- [x] [Bitonic](./src/sorting/bitonic_sort.rs)\n- [x] [Bogo Bogo](./src/sorting/bogo_bogo_sort.rs)\n- [x] [Bogo](./src/sorting/bogo_sort.rs)\n- [x] [Bubble](./src/sorting/bubble_sort.rs)\n- [x] [Bucket](./src/sorting/bucket_sort.rs)\n- [x] [Cocktail-Shaker](./src/sorting/cocktail_shaker_sort.rs)\n- [x] [Comb](./src/sorting/comb_sort.rs)\n- [x] [Counting](./src/sorting/counting_sort.rs)\n- [x] [Cycle](./src/sorting/cycle_sort.rs)\n- [x] [Exchange](./src/sorting/exchange_sort.rs)\n- [x] [Gnome](./src/sorting/gnome_sort.rs)\n- [x] [Heap](./src/sorting/heap_sort.rs)\n- [x] [Insertion](./src/sorting/insertion_sort.rs)\n- [x] [Merge](./src/sorting/merge_sort.rs)\n- [x] [Odd-even](./src/sorting/odd_even_sort.rs)\n- [x] [Pancake](./src/sorting/pancake_sort.rs)\n- [x] [Pigeonhole](./src/sorting/pigeonhole_sort.rs)\n- [x] [Quick](./src/sorting/quick_sort.rs)\n- [x] [Radix](./src/sorting/radix_sort.rs)\n- [x] [Selection](./src/sorting/selection_sort.rs)\n- [x] [Shell](./src/sorting/shell_sort.rs)\n- [x] [Sleep](./src/sorting/sleep_sort.rs)\n- [x] [Stooge](./src/sorting/stooge_sort.rs)\n- [x] [Strand](./src/sorting/strand_sort.rs)\n- [x] [Timsort](./src/sorting/tim_sort.rs)\n- [x] [Tree](./src/sorting/tree_sort.rs)\n\n### Graphs\n\n- [x] [Bellman-Ford](./src/graph/bellman_ford.rs)\n- [x] [Breadth-First Search (BFS)](./src/graph/breadth_first_search.rs)\n- [x] [Centroid Decomposition](./src/graph/centroid_decomposition.rs)\n- [x] [Depth First Search (DFS)](./src/graph/depth_first_search.rs)\n- [x] [Dijkstra](./src/graph/dijkstra.rs)\n- [x] [Dinic's Max Flow](./src/graph/dinic_maxflow.rs)\n- [x] [Heavy Light Decomposition](./src/graph/heavy_light_decomposition.rs)\n- [x] [Kruskal's Minimum Spanning Tree](./src/graph/minimum_spanning_tree.rs)\n- [x] [Lowest Common Ancestor](./src/graph/lowest_common_ancestor.rs)\n- [x] [Prim's Minimum Spanning Tree](./src/graph/prim.rs)\n- [x] [Prufer Code](./src/graph/prufer_code.rs)\n- [x] [Tarjan's Strongly Connected Components](./src/graph/strongly_connected_components.rs)\n- [x] [Topological sorting](./src/graph/topological_sort.rs)\n\n### Dynamic Programming\n\n- [x] [0-1 Knapsack](./src/dynamic_programming/knapsack.rs)\n- [x] [Coin Change](./src/dynamic_programming/coin_change.rs)\n- [x] [Edit Distance](./src/dynamic_programming/edit_distance.rs)\n- [x] [Egg Dropping Puzzle](./src/dynamic_programming/egg_dropping.rs)\n- [x] [Is Subsequence](./src/dynamic_programming/is_subsequence.rs)\n- [x] [K-Means Clustering](./src/general/kmeans.rs)\n- [x] [Longest common subsequence](./src/dynamic_programming/longest_common_subsequence.rs)\n- [x] [Longest continuous increasing subsequence](./src/dynamic_programming/longest_continuous_increasing_subsequence.rs)\n- [x] [Longest increasing subsequence](./src/dynamic_programming/longest_increasing_subsequence.rs)\n- [x] [Maximal Square](./src/dynamic_programming/maximal_square.rs)\n- [x] [Maximum Subarray](./src/dynamic_programming/maximum_subarray.rs)\n- [x] [Rod Cutting](./src/dynamic_programming/rod_cutting.rs)\n\n### Data Structures\n\n- [x] [AVL Tree](./src/data_structures/avl_tree.rs)\n- [x] [B-Tree](./src/data_structures/b_tree.rs)\n- [x] [Binary Search Tree](./src/data_structures/binary_search_tree.rs)\n- [x] [Fenwick Tree](./src/data_structures/fenwick_tree.rs)\n- [x] [Graph](./src/data_structures/graph.rs)\n  - [x] [Directed](./src/data_structures/graph.rs)\n  - [x] [Undirected](./src/data_structures/graph.rs)\n- [x] [Heap](./src/data_structures/heap.rs)\n- [x] [Hashtable](./src/data_structures/hashtable.rs)\n- [x] [Linked List](./src/data_structures/linked_list.rs)\n- [x] [Queue](./src/data_structures/queue.rs)\n- [x] [RB Tree](./src/data_structures/rb_tree.rs)\n- [x] [Segment Tree](./src/data_structures/segment_tree.rs)\n- [x] [Stack using Linked List](./src/data_structures/stack_using_singly_linked_list.rs)\n- [x] [Stack](./src/data_structures/stack.rs)\n- [x] [Trie](./src/data_structures/trie.rs)\n- [x] [Union-find](./src/data_structures/union_find.rs)\n\n### Strings\n\n- [x] [Aho-Corasick Algorithm](./src/string/aho_corasick.rs)\n- [x] [Burrows-Wheeler transform](./src/string/burrows_wheeler_transform.rs)\n- [ ] Finite Automaton\n- [x] [Hamming Distance](./src/string/hamming_distance.rs)\n- [x] [Knuth Morris Pratt](./src/string/knuth_morris_pratt.rs)\n- [x] [Manacher](./src/string/manacher.rs)\n- [x] [Naive](./src/string/naive.rs)\n- [x] [Rabin Carp](./src/string/rabin_karp.rs)\n- [x] [Reverse](./src/string/reverse.rs)\n\n### General\n\n- [x] [Convex Hull: Graham Scan](./src/general/convex_hull.rs)\n- [x] [Graph Coloring](./src/general/graph_coloring.rs)\n- [x] [Huffman Encoding](./src/general/huffman_encoding.rs)\n- [x] [Kmeans](./src/general/kmeans.rs)\n- [x] [N-Queens Problem](./src/general/nqueens.rs)\n- [x] [Tower of Hanoi](./src/general/hanoi.rs)\n- [x] [Two Sum](./src/general/two_sum.rs)\n\n### Ciphers\n\n- [x] [Caesar](./src/ciphers/caesar.rs)\n- [x] [Morse Code](./src/ciphers/morse_code.rs)\n- [x] [Polybius](./src/ciphers/polybius.rs)\n- [x] [SHA-2](./src/ciphers/sha256.rs)\n- [x] [TEA](./src/ciphers/tea.rs)\n- [x] [Transposition](./src/ciphers/transposition.rs)\n- [x] [Vigenère](./src/ciphers/vigenere.rs)\n- [x] [XOR](./src/ciphers/xor.rs)\n- Rot13\n  - [x] [Another Rot13](./src/ciphers/another_rot13.rs)\n  - [x] [Rot13](./src/ciphers/rot13.rs)\n\n### Bit Manipulation\n\n- [x] [Bit Distance](./src/bit_manipulation/basic.rs)\n- [x] [Bit Equivalence](./src/bit_manipulation/basic.rs)\n- [x] [Clear Bit](./src/bit_manipulation/basic.rs)\n- [x] [Count Ones](./src/bit_manipulation/basic.rs)\n- [x] [Divide By Two](./src/bit_manipulation/basic.rs)\n- [x] [Get Bit](./src/bit_manipulation/basic.rs)\n- [x] [Is Even](./src/bit_manipulation/basic.rs)\n- [x] [Is Positive](./src/bit_manipulation/basic.rs)\n- [x] [Is Power Of Two](./src/bit_manipulation/basic.rs)\n- [x] [Multiply By Two](./src/bit_manipulation/basic.rs)\n- [x] [Multiply Signed](./src/bit_manipulation/basic.rs)\n- [x] [Multiply Unsigned](./src/bit_manipulation/basic.rs)\n- [x] [Rightmost 1-bit](./src/bit_manipulation/basic.rs)\n- [x] [Rightmost 0-bit](./src/bit_manipulation/basic.rs)\n- [x] [Set Bit](./src/bit_manipulation/basic.rs)\n- [x] [Twos Complement](./src/bit_manipulation/basic.rs)\n- [x] [Update Bit](./src/bit_manipulation/basic.rs)\n\n### Geometry\n\n- [x] [Closest pair of 2D points](./src/geometry/closest_points.rs)\n\n### Search\n\n- [x] [Binary Search Recursive](./src/searching/binary_search_recursive.rs)\n- [x] [Binary Search](./src/searching/binary_search.rs)\n- [x] [Exponential](./src/searching/exponential_search.rs)\n- [x] [Fibonacci](./src/searching/fibonacci_search.rs)\n- [x] [Jump](./src/searching/jump_search.rs)\n- [x] [Kth Smallest](./src/searching/kth_smallest.rs)\n- [x] [Linear](./src/searching/linear_search.rs)\n- [x] [Quick Select](./src/searching/quick_select.rs)\n- [x] [Ternary Search Min Max Recursive](./src/searching/ternary_search_min_max_recursive.rs)\n- [x] [Ternary Search Min Max](./src/searching/ternary_search_min_max.rs)\n- [x] [Ternary Search Recursive](./src/searching/ternary_search_recursive.rs)\n- [x] [Ternary Search](./src/searching/ternary_search.rs)\n\n### Math\n\n- [x] [Armstrong Number](./src/math/armstrong_number.rs)\n- [x] [Baby-Step Giant-Step Algorithm](./src/math/baby_step_giant_step.rs)\n- [x] [Derivative](./src/math/derivative_method.rs)\n- [x] [Extended euclidean algorithm](./src/math/extended_euclidean_algorithm.rs)\n- [x] [Fast Fourier Transform](./src/math/fast_fourier_transform.rs)\n- [x] [Fast power algorithm](./src/math/fast_power.rs)\n- [x] [Gaussian Elimination](./src/math/gaussian_elimination.rs)\n- [x] [Greatest common divisor of n numbers](./src/math/gcd_of_n_numbers.rs)\n- [x] [Greatest common divisor](./src/math/greatest_common_divisor.rs)\n- [x] [Karatsuba Multiplication Algorithm](./src/math/karatsuba_multiplication.rs)\n- [x] [Least common multiple of n numbers](./src/math/lcm_of_n_numbers.rs)\n- [x] [Linear Sieve](./src/math/linear_sieve.rs)\n- [x] [Miller Rabin primality test](./src/math/miller_rabin.rs)\n- [x] [Pascal's triangle](./src/math/pascal_triangle.rs)\n- [x] [Perfect number](./src/math/perfect_numbers.rs)\n- [x] [Permuted Congruential Random Number Generator](./src/math/random.rs)\n- [x] [Pollard's Rho algorithm](./src/math/pollard_rho.rs)\n- [x] [Prime factors](./src/math/prime_factors.rs)\n- [x] [Prime number](./src/math/prime_numbers.rs)\n- [x] [Quadratic Residue](./src/math/quadratic_residue.rs)\n- [x] [Simpson's Rule for Integration](./src/math/simpson_integration.rs)\n- [x] [Square root with Newton's method](./src/math/square_root.rs)\n- [x] [Trapezoidal Integration](./src/math/trapezoidal_integration.rs)\n- [x] [Zeller's Congruence Algorithm](./src/math/zellers_congruence_algorithm.rs)\n\n### Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexfertel%2Frust-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexfertel%2Frust-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexfertel%2Frust-algorithms/lists"}