From 16df2ff3640a907b056035a60e6afa2e94b476a5 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Mon, 3 Jun 2024 22:29:20 +0200 Subject: [PATCH 01/22] Doc: added documentation of negative log likelihood function --- .../loss_function/negative_log_likelihood.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/machine_learning/loss_function/negative_log_likelihood.rs diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs new file mode 100644 index 00000000000..0eca7fb3f2c --- /dev/null +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -0,0 +1,14 @@ +// Negative Log Likelihood Loss Function +// +// The `neg_log_likelihood` function calculates the Negative Log Likelyhood loss, +// which is a loss function used for classification problems in machine learning. +// +// ## Formula +// +// For a pair of actual and predicted values, represented as vectors `y_true` and +// `y_pred`, the Negative Log Likelihood loss is calculated as: +// +// - loss = `-y_true * log(y_pred) - (1 - y_true) * log(1 - y_pred)`. +// +// It returns the average loss by dividing the `total_loss` by total no. of +// elements. From 1ce01421f3e7afb8a7ae9d6c375a531122310268 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Mon, 3 Jun 2024 22:30:19 +0200 Subject: [PATCH 02/22] Feat: created function signature for negative log likelihood --- src/machine_learning/loss_function/negative_log_likelihood.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 0eca7fb3f2c..1dc44427353 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -12,3 +12,5 @@ // // It returns the average loss by dividing the `total_loss` by total no. of // elements. + +pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> f64 {} From cd8240d98b28e49b57fce59ecd559827d585c794 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Mon, 3 Jun 2024 22:30:46 +0200 Subject: [PATCH 03/22] Feat: implementation of the negative log likelihood --- .../loss_function/negative_log_likelihood.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 1dc44427353..c32794d2843 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -13,4 +13,11 @@ // It returns the average loss by dividing the `total_loss` by total no. of // elements. -pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> f64 {} +pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> f64 { + let mut total_loss: f64 = 0.0; + for (p, a) in y_pred.iter().zip(y_true.iter()) { + let loss: f64 = -a * p.ln() - (1.0 - a) * (1.0 - p).ln(); + total_loss += loss; + } + total_loss / (y_pred.len() as f64) +} From 20e1f245b22b4167a2f521ad383c6c7f4386b06b Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Mon, 3 Jun 2024 22:31:11 +0200 Subject: [PATCH 04/22] Test: created a test for the negative log likelihood --- .../loss_function/negative_log_likelihood.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index c32794d2843..e066419d4fd 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -21,3 +21,18 @@ pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> f64 { } total_loss / (y_pred.len() as f64) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_neg_log_likelihood() { + let actual_values: Vec = vec![1.0, 0.0, 1.0]; + let predicted_values: Vec = vec![0.9, 0.1, 0.8]; + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + 0.14462152754328741 + ); + } +} From f83510e2cbaf0a8d0a0c606941ad332541c214ab Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Mon, 3 Jun 2024 22:31:31 +0200 Subject: [PATCH 05/22] Feat: added the needed exports --- src/machine_learning/loss_function/mod.rs | 2 ++ src/machine_learning/mod.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/machine_learning/loss_function/mod.rs b/src/machine_learning/loss_function/mod.rs index c0196666dbf..0637d63e1ef 100644 --- a/src/machine_learning/loss_function/mod.rs +++ b/src/machine_learning/loss_function/mod.rs @@ -3,9 +3,11 @@ mod huber_loss; mod kl_divergence_loss; mod mean_absolute_error_loss; mod mean_squared_error_loss; +mod negative_log_likelihood; pub use self::hinge_loss::hng_loss; pub use self::huber_loss::huber_loss; pub use self::kl_divergence_loss::kld_loss; pub use self::mean_absolute_error_loss::mae_loss; pub use self::mean_squared_error_loss::mse_loss; +pub use self::negative_log_likelihood::neg_log_likelihood; diff --git a/src/machine_learning/mod.rs b/src/machine_learning/mod.rs index a88a811e0ba..c9344a508ef 100644 --- a/src/machine_learning/mod.rs +++ b/src/machine_learning/mod.rs @@ -12,5 +12,6 @@ pub use self::loss_function::huber_loss; pub use self::loss_function::kld_loss; pub use self::loss_function::mae_loss; pub use self::loss_function::mse_loss; +pub use self::loss_function::neg_log_likelihood; pub use self::optimization::gradient_descent; pub use self::optimization::Adam; From a5f956754be34ccab9154aaf5a7f9be62516d437 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 4 Jun 2024 17:45:11 +0200 Subject: [PATCH 06/22] Feat: added explicit checks regarding --- .../loss_function/negative_log_likelihood.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index e066419d4fd..99b355d2cb3 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -13,13 +13,24 @@ // It returns the average loss by dividing the `total_loss` by total no. of // elements. -pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> f64 { +pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { + // Checks if the length of the actual and predicted values are equal + if y_true.len() != y_pred.len() || y_pred.is_empty() { + return None; + } + // Checks values are between 0 and 1 + for (p, a) in y_pred.iter().zip(y_true.iter()) { + if *p < 0.0 || *p > 1.0 || *a < 0.0 || *a > 1.0 { + return None; + } + } + let mut total_loss: f64 = 0.0; for (p, a) in y_pred.iter().zip(y_true.iter()) { let loss: f64 = -a * p.ln() - (1.0 - a) * (1.0 - p).ln(); total_loss += loss; } - total_loss / (y_pred.len() as f64) + Some(total_loss / (y_pred.len() as f64)) } #[cfg(test)] @@ -32,7 +43,7 @@ mod tests { let predicted_values: Vec = vec![0.9, 0.1, 0.8]; assert_eq!( neg_log_likelihood(&actual_values, &predicted_values), - 0.14462152754328741 + Some(0.14462152754328741) ); } } From a56b324f262a8ee25cf9c69c679094361c978fda Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 4 Jun 2024 17:48:15 +0200 Subject: [PATCH 07/22] Test: added test cases for the checks --- .../loss_function/negative_log_likelihood.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 99b355d2cb3..b3e6d36146b 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -46,4 +46,32 @@ mod tests { Some(0.14462152754328741) ); } + + #[test] + fn test_neg_log_likelihood_invalid_length0() { + let actual_values: Vec = vec![1.0, 0.0, 1.0]; + let predicted_values: Vec = vec![0.9, 0.1]; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + } + + #[test] + fn test_neg_log_likelihood_invalid_length1() { + let actual_values: Vec = vec![1.0, 0.0]; + let predicted_values: Vec = vec![0.9, 0.1, 0.8]; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + } + + #[test] + fn test_neg_log_likelihood_invalid_values() { + let actual_values: Vec = vec![1.0, 0.0, 1.0]; + let predicted_values: Vec = vec![1.1, 0.1, 0.8]; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + } + + #[test] + fn test_neg_log_likelihood_empty_prediction() { + let actual_values: Vec = vec![1.0, 0.0, 1.0]; + let predicted_values: Vec = vec![]; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + } } From 886ae770cfbe06611a9b6be5ee152b936a42737d Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 4 Jun 2024 17:56:25 +0200 Subject: [PATCH 08/22] Feat: added another empty check --- src/machine_learning/loss_function/negative_log_likelihood.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index b3e6d36146b..ab3439510e9 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -15,7 +15,7 @@ pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { // Checks if the length of the actual and predicted values are equal - if y_true.len() != y_pred.len() || y_pred.is_empty() { + if y_true.len() != y_pred.len() || y_pred.is_empty() || y_true.is_empty() { return None; } // Checks values are between 0 and 1 From 314e8954b556c64aaca327756cf5ad76a7bc28d3 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 18 Jun 2024 10:51:07 +0200 Subject: [PATCH 09/22] Test: added tests for negative values --- .../loss_function/negative_log_likelihood.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index ab3439510e9..fbd64bb43cd 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -74,4 +74,18 @@ mod tests { let predicted_values: Vec = vec![]; assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); } + + #[test] + fn test_neg_log_likelihood_negative_values0() { + let actual_values: Vec = vec![-1.0, 0.0, 1.0]; + let predicted_values: Vec = vec![0.9, 0.1, 0.8]; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + } + + #[test] + fn test_neg_log_likelihood_negative_values1() { + let actual_values: Vec = vec![1.0, 0.0, 1.0]; + let predicted_values: Vec = vec![0.9, 0.1, -0.8]; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + } } From 748dbd5760820d5b39abc1401ee1efb29db7949b Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 18 Jun 2024 10:53:23 +0200 Subject: [PATCH 10/22] Refactoring: added auxiliary function to check range of values --- .../loss_function/negative_log_likelihood.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index fbd64bb43cd..e5f9f15ec39 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -19,10 +19,8 @@ pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { return None; } // Checks values are between 0 and 1 - for (p, a) in y_pred.iter().zip(y_true.iter()) { - if *p < 0.0 || *p > 1.0 || *a < 0.0 || *a > 1.0 { - return None; - } + if !are_all_values_in_range(y_true) || !are_all_values_in_range(y_pred) { + return None; } let mut total_loss: f64 = 0.0; @@ -89,3 +87,7 @@ mod tests { assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); } } + +fn are_all_values_in_range(values: &[f64]) -> bool { + values.iter().all(|&x| (0.0..=1.0).contains(&x)) +} From c794c087de59c3ce738a69a01e961e0823f71c0b Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 18 Jun 2024 11:00:25 +0200 Subject: [PATCH 11/22] Docs: added link to an article with the explanation --- src/machine_learning/loss_function/negative_log_likelihood.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index e5f9f15ec39..85cbb10deab 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -12,6 +12,8 @@ // // It returns the average loss by dividing the `total_loss` by total no. of // elements. +// +// https://towardsdatascience.com/cross-entropy-negative-log-likelihood-and-all-that-jazz-47a95bd2e81 pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { // Checks if the length of the actual and predicted values are equal From bee6f8fb6d24a7dbbb3e86f71b70dd240149ccbf Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 18 Jun 2024 11:04:56 +0200 Subject: [PATCH 12/22] Fix: fixed cargo clippy warning by moving location of function --- .../loss_function/negative_log_likelihood.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 85cbb10deab..cea3c3c6de1 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -33,6 +33,10 @@ pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { Some(total_loss / (y_pred.len() as f64)) } +fn are_all_values_in_range(values: &[f64]) -> bool { + values.iter().all(|&x| (0.0..=1.0).contains(&x)) +} + #[cfg(test)] mod tests { use super::*; @@ -89,7 +93,3 @@ mod tests { assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); } } - -fn are_all_values_in_range(values: &[f64]) -> bool { - values.iter().all(|&x| (0.0..=1.0).contains(&x)) -} From d925eb3a49e0e53417f10955a779191f68a511eb Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Wed, 19 Jun 2024 15:35:46 +0200 Subject: [PATCH 13/22] Docs: added the algorithm to the directory with link --- DIRECTORY.md | 648 ++++++++++++++++++++++++++------------------------- 1 file changed, 325 insertions(+), 323 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 220e7815dda..0855bc3701f 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -1,326 +1,328 @@ # List of all files ## Src - * Backtracking - * [All Combination Of Size K](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/all_combination_of_size_k.rs) - * [Knight Tour](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/knight_tour.rs) - * [N Queens](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/n_queens.rs) - * [Parentheses Generator](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/parentheses_generator.rs) - * [Permutations](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/permutations.rs) - * [Sudoku](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/sudoku.rs) - * Big Integer - * [Fast Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/fast_factorial.rs) - * [Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/multiply.rs) - * [Poly1305](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/poly1305.rs) - * Bit Manipulation - * [Counting Bits](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/counting_bits.rs) - * [Highest Set Bit](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/highest_set_bit.rs) - * [Sum Of Two Integers](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/sum_of_two_integers.rs) - * Ciphers - * [Aes](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/aes.rs) - * [Another Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/another_rot13.rs) - * [Baconian Cipher](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/baconian_cipher.rs) - * [Base64](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/base64.rs) - * [Blake2B](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/blake2b.rs) - * [Caesar](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/caesar.rs) - * [Chacha](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/chacha.rs) - * [Diffie Hellman](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/diffie_hellman.rs) - * [Hashing Traits](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/hashing_traits.rs) - * [Kerninghan](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/kerninghan.rs) - * [Morse Code](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/morse_code.rs) - * [Polybius](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/polybius.rs) - * [Rail Fence](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rail_fence.rs) - * [Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rot13.rs) - * [Salsa](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/salsa.rs) - * [Sha256](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha256.rs) - * [Sha3](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha3.rs) - * [Tea](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/tea.rs) - * [Theoretical Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/theoretical_rot13.rs) - * [Transposition](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/transposition.rs) - * [Vigenere](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/vigenere.rs) - * [Xor](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/xor.rs) - * Compression - * [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/compression/run_length_encoding.rs) - * Conversions - * [Binary To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_decimal.rs) - * [Binary To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_hexadecimal.rs) - * [Decimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_binary.rs) - * [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_hexadecimal.rs) - * [Hexadecimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_binary.rs) - * [Hexadecimal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_decimal.rs) - * [Octal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_binary.rs) - * [Octal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_decimal.rs) - * Data Structures - * [Avl Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/avl_tree.rs) - * [B Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/b_tree.rs) - * [Binary Search Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/binary_search_tree.rs) - * [Fenwick Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/fenwick_tree.rs) - * [Floyds Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/floyds_algorithm.rs) - * [Graph](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/graph.rs) - * [Hash Table](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/hash_table.rs) - * [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/heap.rs) - * [Infix To Postfix](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/infix_to_postfix.rs) - * [Lazy Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/lazy_segment_tree.rs) - * [Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/linked_list.rs) - * [Postfix Evaluation](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/postfix_evaluation.rs) - * Probabilistic - * [Bloom Filter](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/bloom_filter.rs) - * [Count Min Sketch](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/count_min_sketch.rs) - * [Queue](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/queue.rs) - * [Range Minimum Query](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/range_minimum_query.rs) - * [Rb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/rb_tree.rs) - * [Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree.rs) - * [Segment Tree Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree_recursive.rs) - * [Stack Using Singly Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/stack_using_singly_linked_list.rs) - * [Treap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/treap.rs) - * [Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/trie.rs) - * [Union Find](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/union_find.rs) - * [Veb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/veb_tree.rs) - * Dynamic Programming - * [Coin Change](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/coin_change.rs) - * [Egg Dropping](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/egg_dropping.rs) - * [Fibonacci](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fibonacci.rs) - * [Fractional Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fractional_knapsack.rs) - * [Is Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/is_subsequence.rs) - * [Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/knapsack.rs) - * [Longest Common Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_subsequence.rs) - * [Longest Common Substring](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_substring.rs) - * [Longest Continuous Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_continuous_increasing_subsequence.rs) - * [Longest Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_increasing_subsequence.rs) - * [Matrix Chain Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/matrix_chain_multiply.rs) - * [Maximal Square](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximal_square.rs) - * [Maximum Subarray](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximum_subarray.rs) - * [Minimum Cost Path](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/minimum_cost_path.rs) - * [Rod Cutting](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/rod_cutting.rs) - * [Snail](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/snail.rs) - * [Subset Generation](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/subset_generation.rs) - * [Trapped Rainwater](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/trapped_rainwater.rs) - * [Word Break](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/word_break.rs) - * General - * [Convex Hull](https://github.com/TheAlgorithms/Rust/blob/master/src/general/convex_hull.rs) - * [Fisher Yates Shuffle](https://github.com/TheAlgorithms/Rust/blob/master/src/general/fisher_yates_shuffle.rs) - * [Genetic](https://github.com/TheAlgorithms/Rust/blob/master/src/general/genetic.rs) - * [Hanoi](https://github.com/TheAlgorithms/Rust/blob/master/src/general/hanoi.rs) - * [Huffman Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/general/huffman_encoding.rs) - * [Kadane Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kadane_algorithm.rs) - * [Kmeans](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kmeans.rs) - * [Mex](https://github.com/TheAlgorithms/Rust/blob/master/src/general/mex.rs) - * Permutations - * [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/heap.rs) - * [Naive](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/naive.rs) - * [Steinhaus Johnson Trotter](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/steinhaus_johnson_trotter.rs) - * [Two Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/general/two_sum.rs) - * Geometry - * [Closest Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/closest_points.rs) - * [Graham Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/graham_scan.rs) - * [Jarvis Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/jarvis_scan.rs) - * [Point](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/point.rs) - * [Polygon Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/polygon_points.rs) - * [Ramer Douglas Peucker](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/ramer_douglas_peucker.rs) - * [Segment](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/segment.rs) - * Graph - * [Astar](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/astar.rs) - * [Bellman Ford](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bellman_ford.rs) - * [Bipartite Matching](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bipartite_matching.rs) - * [Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/breadth_first_search.rs) - * [Centroid Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/centroid_decomposition.rs) - * [Decremental Connectivity](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/decremental_connectivity.rs) - * [Depth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search.rs) - * [Depth First Search Tic Tac Toe](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search_tic_tac_toe.rs) - * [Detect Cycle](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/detect_cycle.rs) - * [Dijkstra](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dijkstra.rs) - * [Dinic Maxflow](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dinic_maxflow.rs) - * [Disjoint Set Union](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/disjoint_set_union.rs) - * [Eulerian Path](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/eulerian_path.rs) - * [Floyd Warshall](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/floyd_warshall.rs) - * [Ford Fulkerson](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/ford_fulkerson.rs) - * [Graph Enumeration](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/graph_enumeration.rs) - * [Heavy Light Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/heavy_light_decomposition.rs) - * [Kosaraju](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/kosaraju.rs) - * [Lee Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lee_breadth_first_search.rs) - * [Lowest Common Ancestor](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lowest_common_ancestor.rs) - * [Minimum Spanning Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/minimum_spanning_tree.rs) - * [Prim](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prim.rs) - * [Prufer Code](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prufer_code.rs) - * [Strongly Connected Components](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/strongly_connected_components.rs) - * [Tarjans Ssc](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/tarjans_ssc.rs) - * [Topological Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/topological_sort.rs) - * [Two Satisfiability](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/two_satisfiability.rs) - * [Lib](https://github.com/TheAlgorithms/Rust/blob/master/src/lib.rs) - * Machine Learning - * [Cholesky](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/cholesky.rs) - * [K Means](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/k_means.rs) - * [Linear Regression](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/linear_regression.rs) - * Loss Function - * [Hinge Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/hinge_loss.rs) - * [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/huber_loss.rs) - * [Kl Divergence Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/kl_divergence_loss.rs) - * [Mean Absolute Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_absolute_error_loss.rs) - * [Mean Squared Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_squared_error_loss.rs) - * Optimization - * [Adam](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/adam.rs) - * [Gradient Descent](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/gradient_descent.rs) - * Math - * [Abs](https://github.com/TheAlgorithms/Rust/blob/master/src/math/abs.rs) - * [Aliquot Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/aliquot_sum.rs) - * [Amicable Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/amicable_numbers.rs) - * [Area Of Polygon](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_of_polygon.rs) - * [Area Under Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_under_curve.rs) - * [Armstrong Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/armstrong_number.rs) - * [Average](https://github.com/TheAlgorithms/Rust/blob/master/src/math/average.rs) - * [Baby Step Giant Step](https://github.com/TheAlgorithms/Rust/blob/master/src/math/baby_step_giant_step.rs) - * [Bell Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/bell_numbers.rs) - * [Binary Exponentiation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binary_exponentiation.rs) - * [Binomial Coefficient](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binomial_coefficient.rs) - * [Catalan Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/catalan_numbers.rs) - * [Ceil](https://github.com/TheAlgorithms/Rust/blob/master/src/math/ceil.rs) - * [Chinese Remainder Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/chinese_remainder_theorem.rs) - * [Collatz Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/collatz_sequence.rs) - * [Combinations](https://github.com/TheAlgorithms/Rust/blob/master/src/math/combinations.rs) - * [Cross Entropy Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/cross_entropy_loss.rs) - * [Decimal To Fraction](https://github.com/TheAlgorithms/Rust/blob/master/src/math/decimal_to_fraction.rs) - * [Doomsday](https://github.com/TheAlgorithms/Rust/blob/master/src/math/doomsday.rs) - * [Elliptic Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/elliptic_curve.rs) - * [Euclidean Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/math/euclidean_distance.rs) - * [Exponential Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/exponential_linear_unit.rs) - * [Extended Euclidean Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/extended_euclidean_algorithm.rs) - * [Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factorial.rs) - * [Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factors.rs) - * [Fast Fourier Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_fourier_transform.rs) - * [Fast Power](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_power.rs) - * [Faster Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/faster_perfect_numbers.rs) - * [Field](https://github.com/TheAlgorithms/Rust/blob/master/src/math/field.rs) - * [Frizzy Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/frizzy_number.rs) - * [Gaussian Elimination](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_elimination.rs) - * [Gaussian Error Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_error_linear_unit.rs) - * [Gcd Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gcd_of_n_numbers.rs) - * [Geometric Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/geometric_series.rs) - * [Greatest Common Divisor](https://github.com/TheAlgorithms/Rust/blob/master/src/math/greatest_common_divisor.rs) - * [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/huber_loss.rs) - * [Interest](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interest.rs) - * [Interpolation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interpolation.rs) - * [Interquartile Range](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interquartile_range.rs) - * [Karatsuba Multiplication](https://github.com/TheAlgorithms/Rust/blob/master/src/math/karatsuba_multiplication.rs) - * [Lcm Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lcm_of_n_numbers.rs) - * [Leaky Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/leaky_relu.rs) - * [Least Square Approx](https://github.com/TheAlgorithms/Rust/blob/master/src/math/least_square_approx.rs) - * [Linear Sieve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/linear_sieve.rs) - * [Logarithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/logarithm.rs) - * [Lucas Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lucas_series.rs) - * [Matrix Ops](https://github.com/TheAlgorithms/Rust/blob/master/src/math/matrix_ops.rs) - * [Mersenne Primes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/mersenne_primes.rs) - * [Miller Rabin](https://github.com/TheAlgorithms/Rust/blob/master/src/math/miller_rabin.rs) - * [Modular Exponential](https://github.com/TheAlgorithms/Rust/blob/master/src/math/modular_exponential.rs) - * [Newton Raphson](https://github.com/TheAlgorithms/Rust/blob/master/src/math/newton_raphson.rs) - * [Nthprime](https://github.com/TheAlgorithms/Rust/blob/master/src/math/nthprime.rs) - * [Pascal Triangle](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pascal_triangle.rs) - * [Perfect Cube](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_cube.rs) - * [Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_numbers.rs) - * [Perfect Square](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_square.rs) - * [Pollard Rho](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pollard_rho.rs) - * [Prime Check](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_check.rs) - * [Prime Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_factors.rs) - * [Prime Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_numbers.rs) - * [Quadratic Residue](https://github.com/TheAlgorithms/Rust/blob/master/src/math/quadratic_residue.rs) - * [Random](https://github.com/TheAlgorithms/Rust/blob/master/src/math/random.rs) - * [Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/relu.rs) - * [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sieve_of_eratosthenes.rs) - * [Sigmoid](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sigmoid.rs) - * [Signum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/signum.rs) - * [Simpsons Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/simpsons_integration.rs) - * [Softmax](https://github.com/TheAlgorithms/Rust/blob/master/src/math/softmax.rs) - * [Sprague Grundy Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sprague_grundy_theorem.rs) - * [Square Pyramidal Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_pyramidal_numbers.rs) - * [Square Root](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_root.rs) - * [Sum Of Digits](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_digits.rs) - * [Sum Of Geometric Progression](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_geometric_progression.rs) - * [Sum Of Harmonic Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_harmonic_series.rs) - * [Sylvester Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sylvester_sequence.rs) - * [Tanh](https://github.com/TheAlgorithms/Rust/blob/master/src/math/tanh.rs) - * [Trapezoidal Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trapezoidal_integration.rs) - * [Trial Division](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trial_division.rs) - * [Trig Functions](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trig_functions.rs) - * [Vector Cross Product](https://github.com/TheAlgorithms/Rust/blob/master/src/math/vector_cross_product.rs) - * [Zellers Congruence Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/zellers_congruence_algorithm.rs) - * Navigation - * [Bearing](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/bearing.rs) - * [Haversine](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/haversine.rs) - * Number Theory - * [Compute Totient](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/compute_totient.rs) - * [Kth Factor](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/kth_factor.rs) - * Searching - * [Binary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search.rs) - * [Binary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search_recursive.rs) - * [Exponential Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/exponential_search.rs) - * [Fibonacci Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/fibonacci_search.rs) - * [Interpolation Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/interpolation_search.rs) - * [Jump Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/jump_search.rs) - * [Kth Smallest](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest.rs) - * [Kth Smallest Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest_heap.rs) - * [Linear Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/linear_search.rs) - * [Moore Voting](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/moore_voting.rs) - * [Quick Select](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/quick_select.rs) - * [Saddleback Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/saddleback_search.rs) - * [Ternary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search.rs) - * [Ternary Search Min Max](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max.rs) - * [Ternary Search Min Max Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max_recursive.rs) - * [Ternary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_recursive.rs) - * Sorting - * [Bead Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bead_sort.rs) - * [Binary Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/binary_insertion_sort.rs) - * [Bingo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bingo_sort.rs) - * [Bitonic Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bitonic_sort.rs) - * [Bogo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bogo_sort.rs) - * [Bubble Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bubble_sort.rs) - * [Bucket Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bucket_sort.rs) - * [Cocktail Shaker Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cocktail_shaker_sort.rs) - * [Comb Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/comb_sort.rs) - * [Counting Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/counting_sort.rs) - * [Cycle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cycle_sort.rs) - * [Dutch National Flag Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/dutch_national_flag_sort.rs) - * [Exchange Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/exchange_sort.rs) - * [Gnome Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/gnome_sort.rs) - * [Heap Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/heap_sort.rs) - * [Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/insertion_sort.rs) - * [Intro Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/intro_sort.rs) - * [Merge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/merge_sort.rs) - * [Odd Even Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/odd_even_sort.rs) - * [Pancake Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pancake_sort.rs) - * [Patience Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/patience_sort.rs) - * [Pigeonhole Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pigeonhole_sort.rs) - * [Quick Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort.rs) - * [Quick Sort 3_ways](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort_3_ways.rs) - * [Radix Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/radix_sort.rs) - * [Selection Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/selection_sort.rs) - * [Shell Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/shell_sort.rs) - * [Sleep Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sleep_sort.rs) - * [Sort Utils](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sort_utils.rs) - * [Stooge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/stooge_sort.rs) - * [Tim Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tim_sort.rs) - * [Tree Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tree_sort.rs) - * [Wave Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wave_sort.rs) - * [Wiggle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wiggle_sort.rs) - * String - * [Aho Corasick](https://github.com/TheAlgorithms/Rust/blob/master/src/string/aho_corasick.rs) - * [Anagram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/anagram.rs) - * [Autocomplete Using Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/string/autocomplete_using_trie.rs) - * [Boyer Moore Search](https://github.com/TheAlgorithms/Rust/blob/master/src/string/boyer_moore_search.rs) - * [Burrows Wheeler Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/string/burrows_wheeler_transform.rs) - * [Duval Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/duval_algorithm.rs) - * [Hamming Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/hamming_distance.rs) - * [Isomorphism](https://github.com/TheAlgorithms/Rust/blob/master/src/string/isomorphism.rs) - * [Jaro Winkler Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/jaro_winkler_distance.rs) - * [Knuth Morris Pratt](https://github.com/TheAlgorithms/Rust/blob/master/src/string/knuth_morris_pratt.rs) - * [Levenshtein Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/levenshtein_distance.rs) - * [Lipogram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/lipogram.rs) - * [Manacher](https://github.com/TheAlgorithms/Rust/blob/master/src/string/manacher.rs) - * [Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/palindrome.rs) - * [Pangram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/pangram.rs) - * [Rabin Karp](https://github.com/TheAlgorithms/Rust/blob/master/src/string/rabin_karp.rs) - * [Reverse](https://github.com/TheAlgorithms/Rust/blob/master/src/string/reverse.rs) - * [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/string/run_length_encoding.rs) - * [Shortest Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/shortest_palindrome.rs) - * [Suffix Array](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array.rs) - * [Suffix Array Manber Myers](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array_manber_myers.rs) - * [Suffix Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_tree.rs) - * [Z Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/z_algorithm.rs) + +- Backtracking + - [All Combination Of Size K](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/all_combination_of_size_k.rs) + - [Knight Tour](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/knight_tour.rs) + - [N Queens](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/n_queens.rs) + - [Parentheses Generator](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/parentheses_generator.rs) + - [Permutations](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/permutations.rs) + - [Sudoku](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/sudoku.rs) +- Big Integer + - [Fast Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/fast_factorial.rs) + - [Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/multiply.rs) + - [Poly1305](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/poly1305.rs) +- Bit Manipulation + - [Counting Bits](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/counting_bits.rs) + - [Highest Set Bit](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/highest_set_bit.rs) + - [Sum Of Two Integers](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/sum_of_two_integers.rs) +- Ciphers + - [Aes](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/aes.rs) + - [Another Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/another_rot13.rs) + - [Baconian Cipher](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/baconian_cipher.rs) + - [Base64](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/base64.rs) + - [Blake2B](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/blake2b.rs) + - [Caesar](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/caesar.rs) + - [Chacha](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/chacha.rs) + - [Diffie Hellman](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/diffie_hellman.rs) + - [Hashing Traits](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/hashing_traits.rs) + - [Kerninghan](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/kerninghan.rs) + - [Morse Code](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/morse_code.rs) + - [Polybius](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/polybius.rs) + - [Rail Fence](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rail_fence.rs) + - [Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rot13.rs) + - [Salsa](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/salsa.rs) + - [Sha256](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha256.rs) + - [Sha3](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha3.rs) + - [Tea](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/tea.rs) + - [Theoretical Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/theoretical_rot13.rs) + - [Transposition](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/transposition.rs) + - [Vigenere](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/vigenere.rs) + - [Xor](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/xor.rs) +- Compression + - [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/compression/run_length_encoding.rs) +- Conversions + - [Binary To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_decimal.rs) + - [Binary To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_hexadecimal.rs) + - [Decimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_binary.rs) + - [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_hexadecimal.rs) + - [Hexadecimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_binary.rs) + - [Hexadecimal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_decimal.rs) + - [Octal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_binary.rs) + - [Octal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_decimal.rs) +- Data Structures + - [Avl Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/avl_tree.rs) + - [B Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/b_tree.rs) + - [Binary Search Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/binary_search_tree.rs) + - [Fenwick Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/fenwick_tree.rs) + - [Floyds Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/floyds_algorithm.rs) + - [Graph](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/graph.rs) + - [Hash Table](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/hash_table.rs) + - [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/heap.rs) + - [Infix To Postfix](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/infix_to_postfix.rs) + - [Lazy Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/lazy_segment_tree.rs) + - [Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/linked_list.rs) + - [Postfix Evaluation](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/postfix_evaluation.rs) + - Probabilistic + - [Bloom Filter](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/bloom_filter.rs) + - [Count Min Sketch](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/count_min_sketch.rs) + - [Queue](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/queue.rs) + - [Range Minimum Query](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/range_minimum_query.rs) + - [Rb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/rb_tree.rs) + - [Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree.rs) + - [Segment Tree Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree_recursive.rs) + - [Stack Using Singly Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/stack_using_singly_linked_list.rs) + - [Treap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/treap.rs) + - [Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/trie.rs) + - [Union Find](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/union_find.rs) + - [Veb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/veb_tree.rs) +- Dynamic Programming + - [Coin Change](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/coin_change.rs) + - [Egg Dropping](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/egg_dropping.rs) + - [Fibonacci](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fibonacci.rs) + - [Fractional Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fractional_knapsack.rs) + - [Is Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/is_subsequence.rs) + - [Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/knapsack.rs) + - [Longest Common Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_subsequence.rs) + - [Longest Common Substring](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_substring.rs) + - [Longest Continuous Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_continuous_increasing_subsequence.rs) + - [Longest Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_increasing_subsequence.rs) + - [Matrix Chain Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/matrix_chain_multiply.rs) + - [Maximal Square](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximal_square.rs) + - [Maximum Subarray](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximum_subarray.rs) + - [Minimum Cost Path](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/minimum_cost_path.rs) + - [Rod Cutting](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/rod_cutting.rs) + - [Snail](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/snail.rs) + - [Subset Generation](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/subset_generation.rs) + - [Trapped Rainwater](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/trapped_rainwater.rs) + - [Word Break](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/word_break.rs) +- General + - [Convex Hull](https://github.com/TheAlgorithms/Rust/blob/master/src/general/convex_hull.rs) + - [Fisher Yates Shuffle](https://github.com/TheAlgorithms/Rust/blob/master/src/general/fisher_yates_shuffle.rs) + - [Genetic](https://github.com/TheAlgorithms/Rust/blob/master/src/general/genetic.rs) + - [Hanoi](https://github.com/TheAlgorithms/Rust/blob/master/src/general/hanoi.rs) + - [Huffman Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/general/huffman_encoding.rs) + - [Kadane Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kadane_algorithm.rs) + - [Kmeans](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kmeans.rs) + - [Mex](https://github.com/TheAlgorithms/Rust/blob/master/src/general/mex.rs) + - Permutations + - [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/heap.rs) + - [Naive](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/naive.rs) + - [Steinhaus Johnson Trotter](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/steinhaus_johnson_trotter.rs) + - [Two Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/general/two_sum.rs) +- Geometry + - [Closest Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/closest_points.rs) + - [Graham Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/graham_scan.rs) + - [Jarvis Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/jarvis_scan.rs) + - [Point](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/point.rs) + - [Polygon Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/polygon_points.rs) + - [Ramer Douglas Peucker](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/ramer_douglas_peucker.rs) + - [Segment](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/segment.rs) +- Graph + - [Astar](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/astar.rs) + - [Bellman Ford](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bellman_ford.rs) + - [Bipartite Matching](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bipartite_matching.rs) + - [Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/breadth_first_search.rs) + - [Centroid Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/centroid_decomposition.rs) + - [Decremental Connectivity](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/decremental_connectivity.rs) + - [Depth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search.rs) + - [Depth First Search Tic Tac Toe](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search_tic_tac_toe.rs) + - [Detect Cycle](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/detect_cycle.rs) + - [Dijkstra](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dijkstra.rs) + - [Dinic Maxflow](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dinic_maxflow.rs) + - [Disjoint Set Union](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/disjoint_set_union.rs) + - [Eulerian Path](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/eulerian_path.rs) + - [Floyd Warshall](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/floyd_warshall.rs) + - [Ford Fulkerson](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/ford_fulkerson.rs) + - [Graph Enumeration](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/graph_enumeration.rs) + - [Heavy Light Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/heavy_light_decomposition.rs) + - [Kosaraju](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/kosaraju.rs) + - [Lee Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lee_breadth_first_search.rs) + - [Lowest Common Ancestor](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lowest_common_ancestor.rs) + - [Minimum Spanning Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/minimum_spanning_tree.rs) + - [Prim](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prim.rs) + - [Prufer Code](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prufer_code.rs) + - [Strongly Connected Components](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/strongly_connected_components.rs) + - [Tarjans Ssc](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/tarjans_ssc.rs) + - [Topological Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/topological_sort.rs) + - [Two Satisfiability](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/two_satisfiability.rs) +- [Lib](https://github.com/TheAlgorithms/Rust/blob/master/src/lib.rs) +- Machine Learning + - [Cholesky](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/cholesky.rs) + - [K Means](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/k_means.rs) + - [Linear Regression](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/linear_regression.rs) + - Loss Function + - [Hinge Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/hinge_loss.rs) + - [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/huber_loss.rs) + - [Kl Divergence Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/kl_divergence_loss.rs) + - [Mean Absolute Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_absolute_error_loss.rs) + - [Mean Squared Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_squared_error_loss.rs) + - [Negative Log Likelihood Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/negative_log_likelihood.rs) + - Optimization + - [Adam](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/adam.rs) + - [Gradient Descent](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/gradient_descent.rs) +- Math + - [Abs](https://github.com/TheAlgorithms/Rust/blob/master/src/math/abs.rs) + - [Aliquot Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/aliquot_sum.rs) + - [Amicable Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/amicable_numbers.rs) + - [Area Of Polygon](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_of_polygon.rs) + - [Area Under Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_under_curve.rs) + - [Armstrong Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/armstrong_number.rs) + - [Average](https://github.com/TheAlgorithms/Rust/blob/master/src/math/average.rs) + - [Baby Step Giant Step](https://github.com/TheAlgorithms/Rust/blob/master/src/math/baby_step_giant_step.rs) + - [Bell Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/bell_numbers.rs) + - [Binary Exponentiation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binary_exponentiation.rs) + - [Binomial Coefficient](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binomial_coefficient.rs) + - [Catalan Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/catalan_numbers.rs) + - [Ceil](https://github.com/TheAlgorithms/Rust/blob/master/src/math/ceil.rs) + - [Chinese Remainder Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/chinese_remainder_theorem.rs) + - [Collatz Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/collatz_sequence.rs) + - [Combinations](https://github.com/TheAlgorithms/Rust/blob/master/src/math/combinations.rs) + - [Cross Entropy Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/cross_entropy_loss.rs) + - [Decimal To Fraction](https://github.com/TheAlgorithms/Rust/blob/master/src/math/decimal_to_fraction.rs) + - [Doomsday](https://github.com/TheAlgorithms/Rust/blob/master/src/math/doomsday.rs) + - [Elliptic Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/elliptic_curve.rs) + - [Euclidean Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/math/euclidean_distance.rs) + - [Exponential Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/exponential_linear_unit.rs) + - [Extended Euclidean Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/extended_euclidean_algorithm.rs) + - [Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factorial.rs) + - [Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factors.rs) + - [Fast Fourier Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_fourier_transform.rs) + - [Fast Power](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_power.rs) + - [Faster Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/faster_perfect_numbers.rs) + - [Field](https://github.com/TheAlgorithms/Rust/blob/master/src/math/field.rs) + - [Frizzy Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/frizzy_number.rs) + - [Gaussian Elimination](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_elimination.rs) + - [Gaussian Error Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_error_linear_unit.rs) + - [Gcd Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gcd_of_n_numbers.rs) + - [Geometric Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/geometric_series.rs) + - [Greatest Common Divisor](https://github.com/TheAlgorithms/Rust/blob/master/src/math/greatest_common_divisor.rs) + - [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/huber_loss.rs) + - [Interest](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interest.rs) + - [Interpolation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interpolation.rs) + - [Interquartile Range](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interquartile_range.rs) + - [Karatsuba Multiplication](https://github.com/TheAlgorithms/Rust/blob/master/src/math/karatsuba_multiplication.rs) + - [Lcm Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lcm_of_n_numbers.rs) + - [Leaky Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/leaky_relu.rs) + - [Least Square Approx](https://github.com/TheAlgorithms/Rust/blob/master/src/math/least_square_approx.rs) + - [Linear Sieve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/linear_sieve.rs) + - [Logarithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/logarithm.rs) + - [Lucas Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lucas_series.rs) + - [Matrix Ops](https://github.com/TheAlgorithms/Rust/blob/master/src/math/matrix_ops.rs) + - [Mersenne Primes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/mersenne_primes.rs) + - [Miller Rabin](https://github.com/TheAlgorithms/Rust/blob/master/src/math/miller_rabin.rs) + - [Modular Exponential](https://github.com/TheAlgorithms/Rust/blob/master/src/math/modular_exponential.rs) + - [Newton Raphson](https://github.com/TheAlgorithms/Rust/blob/master/src/math/newton_raphson.rs) + - [Nthprime](https://github.com/TheAlgorithms/Rust/blob/master/src/math/nthprime.rs) + - [Pascal Triangle](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pascal_triangle.rs) + - [Perfect Cube](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_cube.rs) + - [Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_numbers.rs) + - [Perfect Square](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_square.rs) + - [Pollard Rho](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pollard_rho.rs) + - [Prime Check](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_check.rs) + - [Prime Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_factors.rs) + - [Prime Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_numbers.rs) + - [Quadratic Residue](https://github.com/TheAlgorithms/Rust/blob/master/src/math/quadratic_residue.rs) + - [Random](https://github.com/TheAlgorithms/Rust/blob/master/src/math/random.rs) + - [Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/relu.rs) + - [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sieve_of_eratosthenes.rs) + - [Sigmoid](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sigmoid.rs) + - [Signum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/signum.rs) + - [Simpsons Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/simpsons_integration.rs) + - [Softmax](https://github.com/TheAlgorithms/Rust/blob/master/src/math/softmax.rs) + - [Sprague Grundy Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sprague_grundy_theorem.rs) + - [Square Pyramidal Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_pyramidal_numbers.rs) + - [Square Root](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_root.rs) + - [Sum Of Digits](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_digits.rs) + - [Sum Of Geometric Progression](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_geometric_progression.rs) + - [Sum Of Harmonic Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_harmonic_series.rs) + - [Sylvester Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sylvester_sequence.rs) + - [Tanh](https://github.com/TheAlgorithms/Rust/blob/master/src/math/tanh.rs) + - [Trapezoidal Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trapezoidal_integration.rs) + - [Trial Division](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trial_division.rs) + - [Trig Functions](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trig_functions.rs) + - [Vector Cross Product](https://github.com/TheAlgorithms/Rust/blob/master/src/math/vector_cross_product.rs) + - [Zellers Congruence Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/zellers_congruence_algorithm.rs) +- Navigation + - [Bearing](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/bearing.rs) + - [Haversine](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/haversine.rs) +- Number Theory + - [Compute Totient](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/compute_totient.rs) + - [Kth Factor](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/kth_factor.rs) +- Searching + - [Binary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search.rs) + - [Binary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search_recursive.rs) + - [Exponential Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/exponential_search.rs) + - [Fibonacci Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/fibonacci_search.rs) + - [Interpolation Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/interpolation_search.rs) + - [Jump Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/jump_search.rs) + - [Kth Smallest](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest.rs) + - [Kth Smallest Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest_heap.rs) + - [Linear Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/linear_search.rs) + - [Moore Voting](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/moore_voting.rs) + - [Quick Select](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/quick_select.rs) + - [Saddleback Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/saddleback_search.rs) + - [Ternary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search.rs) + - [Ternary Search Min Max](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max.rs) + - [Ternary Search Min Max Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max_recursive.rs) + - [Ternary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_recursive.rs) +- Sorting + - [Bead Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bead_sort.rs) + - [Binary Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/binary_insertion_sort.rs) + - [Bingo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bingo_sort.rs) + - [Bitonic Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bitonic_sort.rs) + - [Bogo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bogo_sort.rs) + - [Bubble Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bubble_sort.rs) + - [Bucket Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bucket_sort.rs) + - [Cocktail Shaker Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cocktail_shaker_sort.rs) + - [Comb Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/comb_sort.rs) + - [Counting Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/counting_sort.rs) + - [Cycle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cycle_sort.rs) + - [Dutch National Flag Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/dutch_national_flag_sort.rs) + - [Exchange Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/exchange_sort.rs) + - [Gnome Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/gnome_sort.rs) + - [Heap Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/heap_sort.rs) + - [Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/insertion_sort.rs) + - [Intro Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/intro_sort.rs) + - [Merge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/merge_sort.rs) + - [Odd Even Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/odd_even_sort.rs) + - [Pancake Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pancake_sort.rs) + - [Patience Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/patience_sort.rs) + - [Pigeonhole Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pigeonhole_sort.rs) + - [Quick Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort.rs) + - [Quick Sort 3_ways](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort_3_ways.rs) + - [Radix Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/radix_sort.rs) + - [Selection Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/selection_sort.rs) + - [Shell Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/shell_sort.rs) + - [Sleep Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sleep_sort.rs) + - [Sort Utils](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sort_utils.rs) + - [Stooge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/stooge_sort.rs) + - [Tim Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tim_sort.rs) + - [Tree Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tree_sort.rs) + - [Wave Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wave_sort.rs) + - [Wiggle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wiggle_sort.rs) +- String + - [Aho Corasick](https://github.com/TheAlgorithms/Rust/blob/master/src/string/aho_corasick.rs) + - [Anagram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/anagram.rs) + - [Autocomplete Using Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/string/autocomplete_using_trie.rs) + - [Boyer Moore Search](https://github.com/TheAlgorithms/Rust/blob/master/src/string/boyer_moore_search.rs) + - [Burrows Wheeler Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/string/burrows_wheeler_transform.rs) + - [Duval Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/duval_algorithm.rs) + - [Hamming Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/hamming_distance.rs) + - [Isomorphism](https://github.com/TheAlgorithms/Rust/blob/master/src/string/isomorphism.rs) + - [Jaro Winkler Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/jaro_winkler_distance.rs) + - [Knuth Morris Pratt](https://github.com/TheAlgorithms/Rust/blob/master/src/string/knuth_morris_pratt.rs) + - [Levenshtein Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/levenshtein_distance.rs) + - [Lipogram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/lipogram.rs) + - [Manacher](https://github.com/TheAlgorithms/Rust/blob/master/src/string/manacher.rs) + - [Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/palindrome.rs) + - [Pangram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/pangram.rs) + - [Rabin Karp](https://github.com/TheAlgorithms/Rust/blob/master/src/string/rabin_karp.rs) + - [Reverse](https://github.com/TheAlgorithms/Rust/blob/master/src/string/reverse.rs) + - [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/string/run_length_encoding.rs) + - [Shortest Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/shortest_palindrome.rs) + - [Suffix Array](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array.rs) + - [Suffix Array Manber Myers](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array_manber_myers.rs) + - [Suffix Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_tree.rs) + - [Z Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/z_algorithm.rs) From 65671b79add3ba11196bf690df47cfe2c50e7743 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Wed, 19 Jun 2024 15:41:43 +0200 Subject: [PATCH 14/22] Fix: reverted the file to previous format --- DIRECTORY.md | 649 +++++++++++++++++++++++++-------------------------- 1 file changed, 324 insertions(+), 325 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 0855bc3701f..141004e91d8 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -1,328 +1,327 @@ # List of all files ## Src - -- Backtracking - - [All Combination Of Size K](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/all_combination_of_size_k.rs) - - [Knight Tour](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/knight_tour.rs) - - [N Queens](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/n_queens.rs) - - [Parentheses Generator](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/parentheses_generator.rs) - - [Permutations](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/permutations.rs) - - [Sudoku](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/sudoku.rs) -- Big Integer - - [Fast Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/fast_factorial.rs) - - [Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/multiply.rs) - - [Poly1305](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/poly1305.rs) -- Bit Manipulation - - [Counting Bits](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/counting_bits.rs) - - [Highest Set Bit](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/highest_set_bit.rs) - - [Sum Of Two Integers](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/sum_of_two_integers.rs) -- Ciphers - - [Aes](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/aes.rs) - - [Another Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/another_rot13.rs) - - [Baconian Cipher](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/baconian_cipher.rs) - - [Base64](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/base64.rs) - - [Blake2B](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/blake2b.rs) - - [Caesar](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/caesar.rs) - - [Chacha](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/chacha.rs) - - [Diffie Hellman](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/diffie_hellman.rs) - - [Hashing Traits](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/hashing_traits.rs) - - [Kerninghan](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/kerninghan.rs) - - [Morse Code](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/morse_code.rs) - - [Polybius](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/polybius.rs) - - [Rail Fence](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rail_fence.rs) - - [Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rot13.rs) - - [Salsa](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/salsa.rs) - - [Sha256](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha256.rs) - - [Sha3](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha3.rs) - - [Tea](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/tea.rs) - - [Theoretical Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/theoretical_rot13.rs) - - [Transposition](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/transposition.rs) - - [Vigenere](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/vigenere.rs) - - [Xor](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/xor.rs) -- Compression - - [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/compression/run_length_encoding.rs) -- Conversions - - [Binary To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_decimal.rs) - - [Binary To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_hexadecimal.rs) - - [Decimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_binary.rs) - - [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_hexadecimal.rs) - - [Hexadecimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_binary.rs) - - [Hexadecimal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_decimal.rs) - - [Octal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_binary.rs) - - [Octal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_decimal.rs) -- Data Structures - - [Avl Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/avl_tree.rs) - - [B Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/b_tree.rs) - - [Binary Search Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/binary_search_tree.rs) - - [Fenwick Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/fenwick_tree.rs) - - [Floyds Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/floyds_algorithm.rs) - - [Graph](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/graph.rs) - - [Hash Table](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/hash_table.rs) - - [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/heap.rs) - - [Infix To Postfix](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/infix_to_postfix.rs) - - [Lazy Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/lazy_segment_tree.rs) - - [Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/linked_list.rs) - - [Postfix Evaluation](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/postfix_evaluation.rs) - - Probabilistic - - [Bloom Filter](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/bloom_filter.rs) - - [Count Min Sketch](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/count_min_sketch.rs) - - [Queue](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/queue.rs) - - [Range Minimum Query](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/range_minimum_query.rs) - - [Rb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/rb_tree.rs) - - [Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree.rs) - - [Segment Tree Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree_recursive.rs) - - [Stack Using Singly Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/stack_using_singly_linked_list.rs) - - [Treap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/treap.rs) - - [Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/trie.rs) - - [Union Find](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/union_find.rs) - - [Veb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/veb_tree.rs) -- Dynamic Programming - - [Coin Change](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/coin_change.rs) - - [Egg Dropping](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/egg_dropping.rs) - - [Fibonacci](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fibonacci.rs) - - [Fractional Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fractional_knapsack.rs) - - [Is Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/is_subsequence.rs) - - [Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/knapsack.rs) - - [Longest Common Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_subsequence.rs) - - [Longest Common Substring](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_substring.rs) - - [Longest Continuous Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_continuous_increasing_subsequence.rs) - - [Longest Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_increasing_subsequence.rs) - - [Matrix Chain Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/matrix_chain_multiply.rs) - - [Maximal Square](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximal_square.rs) - - [Maximum Subarray](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximum_subarray.rs) - - [Minimum Cost Path](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/minimum_cost_path.rs) - - [Rod Cutting](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/rod_cutting.rs) - - [Snail](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/snail.rs) - - [Subset Generation](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/subset_generation.rs) - - [Trapped Rainwater](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/trapped_rainwater.rs) - - [Word Break](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/word_break.rs) -- General - - [Convex Hull](https://github.com/TheAlgorithms/Rust/blob/master/src/general/convex_hull.rs) - - [Fisher Yates Shuffle](https://github.com/TheAlgorithms/Rust/blob/master/src/general/fisher_yates_shuffle.rs) - - [Genetic](https://github.com/TheAlgorithms/Rust/blob/master/src/general/genetic.rs) - - [Hanoi](https://github.com/TheAlgorithms/Rust/blob/master/src/general/hanoi.rs) - - [Huffman Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/general/huffman_encoding.rs) - - [Kadane Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kadane_algorithm.rs) - - [Kmeans](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kmeans.rs) - - [Mex](https://github.com/TheAlgorithms/Rust/blob/master/src/general/mex.rs) - - Permutations - - [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/heap.rs) - - [Naive](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/naive.rs) - - [Steinhaus Johnson Trotter](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/steinhaus_johnson_trotter.rs) - - [Two Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/general/two_sum.rs) -- Geometry - - [Closest Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/closest_points.rs) - - [Graham Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/graham_scan.rs) - - [Jarvis Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/jarvis_scan.rs) - - [Point](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/point.rs) - - [Polygon Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/polygon_points.rs) - - [Ramer Douglas Peucker](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/ramer_douglas_peucker.rs) - - [Segment](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/segment.rs) -- Graph - - [Astar](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/astar.rs) - - [Bellman Ford](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bellman_ford.rs) - - [Bipartite Matching](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bipartite_matching.rs) - - [Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/breadth_first_search.rs) - - [Centroid Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/centroid_decomposition.rs) - - [Decremental Connectivity](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/decremental_connectivity.rs) - - [Depth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search.rs) - - [Depth First Search Tic Tac Toe](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search_tic_tac_toe.rs) - - [Detect Cycle](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/detect_cycle.rs) - - [Dijkstra](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dijkstra.rs) - - [Dinic Maxflow](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dinic_maxflow.rs) - - [Disjoint Set Union](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/disjoint_set_union.rs) - - [Eulerian Path](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/eulerian_path.rs) - - [Floyd Warshall](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/floyd_warshall.rs) - - [Ford Fulkerson](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/ford_fulkerson.rs) - - [Graph Enumeration](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/graph_enumeration.rs) - - [Heavy Light Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/heavy_light_decomposition.rs) - - [Kosaraju](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/kosaraju.rs) - - [Lee Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lee_breadth_first_search.rs) - - [Lowest Common Ancestor](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lowest_common_ancestor.rs) - - [Minimum Spanning Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/minimum_spanning_tree.rs) - - [Prim](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prim.rs) - - [Prufer Code](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prufer_code.rs) - - [Strongly Connected Components](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/strongly_connected_components.rs) - - [Tarjans Ssc](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/tarjans_ssc.rs) - - [Topological Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/topological_sort.rs) - - [Two Satisfiability](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/two_satisfiability.rs) -- [Lib](https://github.com/TheAlgorithms/Rust/blob/master/src/lib.rs) -- Machine Learning - - [Cholesky](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/cholesky.rs) - - [K Means](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/k_means.rs) - - [Linear Regression](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/linear_regression.rs) - - Loss Function - - [Hinge Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/hinge_loss.rs) - - [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/huber_loss.rs) - - [Kl Divergence Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/kl_divergence_loss.rs) - - [Mean Absolute Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_absolute_error_loss.rs) - - [Mean Squared Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_squared_error_loss.rs) - - [Negative Log Likelihood Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/negative_log_likelihood.rs) - - Optimization - - [Adam](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/adam.rs) - - [Gradient Descent](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/gradient_descent.rs) -- Math - - [Abs](https://github.com/TheAlgorithms/Rust/blob/master/src/math/abs.rs) - - [Aliquot Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/aliquot_sum.rs) - - [Amicable Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/amicable_numbers.rs) - - [Area Of Polygon](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_of_polygon.rs) - - [Area Under Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_under_curve.rs) - - [Armstrong Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/armstrong_number.rs) - - [Average](https://github.com/TheAlgorithms/Rust/blob/master/src/math/average.rs) - - [Baby Step Giant Step](https://github.com/TheAlgorithms/Rust/blob/master/src/math/baby_step_giant_step.rs) - - [Bell Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/bell_numbers.rs) - - [Binary Exponentiation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binary_exponentiation.rs) - - [Binomial Coefficient](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binomial_coefficient.rs) - - [Catalan Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/catalan_numbers.rs) - - [Ceil](https://github.com/TheAlgorithms/Rust/blob/master/src/math/ceil.rs) - - [Chinese Remainder Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/chinese_remainder_theorem.rs) - - [Collatz Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/collatz_sequence.rs) - - [Combinations](https://github.com/TheAlgorithms/Rust/blob/master/src/math/combinations.rs) - - [Cross Entropy Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/cross_entropy_loss.rs) - - [Decimal To Fraction](https://github.com/TheAlgorithms/Rust/blob/master/src/math/decimal_to_fraction.rs) - - [Doomsday](https://github.com/TheAlgorithms/Rust/blob/master/src/math/doomsday.rs) - - [Elliptic Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/elliptic_curve.rs) - - [Euclidean Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/math/euclidean_distance.rs) - - [Exponential Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/exponential_linear_unit.rs) - - [Extended Euclidean Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/extended_euclidean_algorithm.rs) - - [Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factorial.rs) - - [Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factors.rs) - - [Fast Fourier Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_fourier_transform.rs) - - [Fast Power](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_power.rs) - - [Faster Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/faster_perfect_numbers.rs) - - [Field](https://github.com/TheAlgorithms/Rust/blob/master/src/math/field.rs) - - [Frizzy Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/frizzy_number.rs) - - [Gaussian Elimination](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_elimination.rs) - - [Gaussian Error Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_error_linear_unit.rs) - - [Gcd Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gcd_of_n_numbers.rs) - - [Geometric Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/geometric_series.rs) - - [Greatest Common Divisor](https://github.com/TheAlgorithms/Rust/blob/master/src/math/greatest_common_divisor.rs) - - [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/huber_loss.rs) - - [Interest](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interest.rs) - - [Interpolation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interpolation.rs) - - [Interquartile Range](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interquartile_range.rs) - - [Karatsuba Multiplication](https://github.com/TheAlgorithms/Rust/blob/master/src/math/karatsuba_multiplication.rs) - - [Lcm Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lcm_of_n_numbers.rs) - - [Leaky Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/leaky_relu.rs) - - [Least Square Approx](https://github.com/TheAlgorithms/Rust/blob/master/src/math/least_square_approx.rs) - - [Linear Sieve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/linear_sieve.rs) - - [Logarithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/logarithm.rs) - - [Lucas Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lucas_series.rs) - - [Matrix Ops](https://github.com/TheAlgorithms/Rust/blob/master/src/math/matrix_ops.rs) - - [Mersenne Primes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/mersenne_primes.rs) - - [Miller Rabin](https://github.com/TheAlgorithms/Rust/blob/master/src/math/miller_rabin.rs) - - [Modular Exponential](https://github.com/TheAlgorithms/Rust/blob/master/src/math/modular_exponential.rs) - - [Newton Raphson](https://github.com/TheAlgorithms/Rust/blob/master/src/math/newton_raphson.rs) - - [Nthprime](https://github.com/TheAlgorithms/Rust/blob/master/src/math/nthprime.rs) - - [Pascal Triangle](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pascal_triangle.rs) - - [Perfect Cube](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_cube.rs) - - [Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_numbers.rs) - - [Perfect Square](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_square.rs) - - [Pollard Rho](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pollard_rho.rs) - - [Prime Check](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_check.rs) - - [Prime Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_factors.rs) - - [Prime Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_numbers.rs) - - [Quadratic Residue](https://github.com/TheAlgorithms/Rust/blob/master/src/math/quadratic_residue.rs) - - [Random](https://github.com/TheAlgorithms/Rust/blob/master/src/math/random.rs) - - [Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/relu.rs) - - [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sieve_of_eratosthenes.rs) - - [Sigmoid](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sigmoid.rs) - - [Signum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/signum.rs) - - [Simpsons Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/simpsons_integration.rs) - - [Softmax](https://github.com/TheAlgorithms/Rust/blob/master/src/math/softmax.rs) - - [Sprague Grundy Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sprague_grundy_theorem.rs) - - [Square Pyramidal Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_pyramidal_numbers.rs) - - [Square Root](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_root.rs) - - [Sum Of Digits](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_digits.rs) - - [Sum Of Geometric Progression](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_geometric_progression.rs) - - [Sum Of Harmonic Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_harmonic_series.rs) - - [Sylvester Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sylvester_sequence.rs) - - [Tanh](https://github.com/TheAlgorithms/Rust/blob/master/src/math/tanh.rs) - - [Trapezoidal Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trapezoidal_integration.rs) - - [Trial Division](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trial_division.rs) - - [Trig Functions](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trig_functions.rs) - - [Vector Cross Product](https://github.com/TheAlgorithms/Rust/blob/master/src/math/vector_cross_product.rs) - - [Zellers Congruence Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/zellers_congruence_algorithm.rs) -- Navigation - - [Bearing](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/bearing.rs) - - [Haversine](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/haversine.rs) -- Number Theory - - [Compute Totient](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/compute_totient.rs) - - [Kth Factor](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/kth_factor.rs) -- Searching - - [Binary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search.rs) - - [Binary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search_recursive.rs) - - [Exponential Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/exponential_search.rs) - - [Fibonacci Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/fibonacci_search.rs) - - [Interpolation Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/interpolation_search.rs) - - [Jump Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/jump_search.rs) - - [Kth Smallest](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest.rs) - - [Kth Smallest Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest_heap.rs) - - [Linear Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/linear_search.rs) - - [Moore Voting](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/moore_voting.rs) - - [Quick Select](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/quick_select.rs) - - [Saddleback Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/saddleback_search.rs) - - [Ternary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search.rs) - - [Ternary Search Min Max](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max.rs) - - [Ternary Search Min Max Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max_recursive.rs) - - [Ternary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_recursive.rs) -- Sorting - - [Bead Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bead_sort.rs) - - [Binary Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/binary_insertion_sort.rs) - - [Bingo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bingo_sort.rs) - - [Bitonic Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bitonic_sort.rs) - - [Bogo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bogo_sort.rs) - - [Bubble Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bubble_sort.rs) - - [Bucket Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bucket_sort.rs) - - [Cocktail Shaker Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cocktail_shaker_sort.rs) - - [Comb Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/comb_sort.rs) - - [Counting Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/counting_sort.rs) - - [Cycle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cycle_sort.rs) - - [Dutch National Flag Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/dutch_national_flag_sort.rs) - - [Exchange Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/exchange_sort.rs) - - [Gnome Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/gnome_sort.rs) - - [Heap Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/heap_sort.rs) - - [Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/insertion_sort.rs) - - [Intro Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/intro_sort.rs) - - [Merge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/merge_sort.rs) - - [Odd Even Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/odd_even_sort.rs) - - [Pancake Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pancake_sort.rs) - - [Patience Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/patience_sort.rs) - - [Pigeonhole Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pigeonhole_sort.rs) - - [Quick Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort.rs) - - [Quick Sort 3_ways](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort_3_ways.rs) - - [Radix Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/radix_sort.rs) - - [Selection Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/selection_sort.rs) - - [Shell Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/shell_sort.rs) - - [Sleep Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sleep_sort.rs) - - [Sort Utils](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sort_utils.rs) - - [Stooge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/stooge_sort.rs) - - [Tim Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tim_sort.rs) - - [Tree Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tree_sort.rs) - - [Wave Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wave_sort.rs) - - [Wiggle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wiggle_sort.rs) -- String - - [Aho Corasick](https://github.com/TheAlgorithms/Rust/blob/master/src/string/aho_corasick.rs) - - [Anagram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/anagram.rs) - - [Autocomplete Using Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/string/autocomplete_using_trie.rs) - - [Boyer Moore Search](https://github.com/TheAlgorithms/Rust/blob/master/src/string/boyer_moore_search.rs) - - [Burrows Wheeler Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/string/burrows_wheeler_transform.rs) - - [Duval Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/duval_algorithm.rs) - - [Hamming Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/hamming_distance.rs) - - [Isomorphism](https://github.com/TheAlgorithms/Rust/blob/master/src/string/isomorphism.rs) - - [Jaro Winkler Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/jaro_winkler_distance.rs) - - [Knuth Morris Pratt](https://github.com/TheAlgorithms/Rust/blob/master/src/string/knuth_morris_pratt.rs) - - [Levenshtein Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/levenshtein_distance.rs) - - [Lipogram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/lipogram.rs) - - [Manacher](https://github.com/TheAlgorithms/Rust/blob/master/src/string/manacher.rs) - - [Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/palindrome.rs) - - [Pangram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/pangram.rs) - - [Rabin Karp](https://github.com/TheAlgorithms/Rust/blob/master/src/string/rabin_karp.rs) - - [Reverse](https://github.com/TheAlgorithms/Rust/blob/master/src/string/reverse.rs) - - [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/string/run_length_encoding.rs) - - [Shortest Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/shortest_palindrome.rs) - - [Suffix Array](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array.rs) - - [Suffix Array Manber Myers](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array_manber_myers.rs) - - [Suffix Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_tree.rs) - - [Z Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/z_algorithm.rs) + * Backtracking + * [All Combination Of Size K](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/all_combination_of_size_k.rs) + * [Knight Tour](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/knight_tour.rs) + * [N Queens](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/n_queens.rs) + * [Parentheses Generator](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/parentheses_generator.rs) + * [Permutations](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/permutations.rs) + * [Sudoku](https://github.com/TheAlgorithms/Rust/blob/master/src/backtracking/sudoku.rs) + * Big Integer + * [Fast Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/fast_factorial.rs) + * [Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/multiply.rs) + * [Poly1305](https://github.com/TheAlgorithms/Rust/blob/master/src/big_integer/poly1305.rs) + * Bit Manipulation + * [Counting Bits](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/counting_bits.rs) + * [Highest Set Bit](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/highest_set_bit.rs) + * [Sum Of Two Integers](https://github.com/TheAlgorithms/Rust/blob/master/src/bit_manipulation/sum_of_two_integers.rs) + * Ciphers + * [Aes](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/aes.rs) + * [Another Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/another_rot13.rs) + * [Baconian Cipher](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/baconian_cipher.rs) + * [Base64](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/base64.rs) + * [Blake2B](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/blake2b.rs) + * [Caesar](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/caesar.rs) + * [Chacha](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/chacha.rs) + * [Diffie Hellman](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/diffie_hellman.rs) + * [Hashing Traits](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/hashing_traits.rs) + * [Kerninghan](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/kerninghan.rs) + * [Morse Code](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/morse_code.rs) + * [Polybius](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/polybius.rs) + * [Rail Fence](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rail_fence.rs) + * [Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/rot13.rs) + * [Salsa](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/salsa.rs) + * [Sha256](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha256.rs) + * [Sha3](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/sha3.rs) + * [Tea](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/tea.rs) + * [Theoretical Rot13](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/theoretical_rot13.rs) + * [Transposition](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/transposition.rs) + * [Vigenere](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/vigenere.rs) + * [Xor](https://github.com/TheAlgorithms/Rust/blob/master/src/ciphers/xor.rs) + * Compression + * [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/compression/run_length_encoding.rs) + * Conversions + * [Binary To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_decimal.rs) + * [Binary To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/binary_to_hexadecimal.rs) + * [Decimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_binary.rs) + * [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/decimal_to_hexadecimal.rs) + * [Hexadecimal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_binary.rs) + * [Hexadecimal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/hexadecimal_to_decimal.rs) + * [Octal To Binary](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_binary.rs) + * [Octal To Decimal](https://github.com/TheAlgorithms/Rust/blob/master/src/conversions/octal_to_decimal.rs) + * Data Structures + * [Avl Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/avl_tree.rs) + * [B Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/b_tree.rs) + * [Binary Search Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/binary_search_tree.rs) + * [Fenwick Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/fenwick_tree.rs) + * [Floyds Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/floyds_algorithm.rs) + * [Graph](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/graph.rs) + * [Hash Table](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/hash_table.rs) + * [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/heap.rs) + * [Infix To Postfix](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/infix_to_postfix.rs) + * [Lazy Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/lazy_segment_tree.rs) + * [Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/linked_list.rs) + * [Postfix Evaluation](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/postfix_evaluation.rs) + * Probabilistic + * [Bloom Filter](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/bloom_filter.rs) + * [Count Min Sketch](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/probabilistic/count_min_sketch.rs) + * [Queue](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/queue.rs) + * [Range Minimum Query](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/range_minimum_query.rs) + * [Rb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/rb_tree.rs) + * [Segment Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree.rs) + * [Segment Tree Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/segment_tree_recursive.rs) + * [Stack Using Singly Linked List](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/stack_using_singly_linked_list.rs) + * [Treap](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/treap.rs) + * [Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/trie.rs) + * [Union Find](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/union_find.rs) + * [Veb Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/data_structures/veb_tree.rs) + * Dynamic Programming + * [Coin Change](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/coin_change.rs) + * [Egg Dropping](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/egg_dropping.rs) + * [Fibonacci](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fibonacci.rs) + * [Fractional Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/fractional_knapsack.rs) + * [Is Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/is_subsequence.rs) + * [Knapsack](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/knapsack.rs) + * [Longest Common Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_subsequence.rs) + * [Longest Common Substring](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_common_substring.rs) + * [Longest Continuous Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_continuous_increasing_subsequence.rs) + * [Longest Increasing Subsequence](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/longest_increasing_subsequence.rs) + * [Matrix Chain Multiply](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/matrix_chain_multiply.rs) + * [Maximal Square](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximal_square.rs) + * [Maximum Subarray](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/maximum_subarray.rs) + * [Minimum Cost Path](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/minimum_cost_path.rs) + * [Rod Cutting](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/rod_cutting.rs) + * [Snail](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/snail.rs) + * [Subset Generation](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/subset_generation.rs) + * [Trapped Rainwater](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/trapped_rainwater.rs) + * [Word Break](https://github.com/TheAlgorithms/Rust/blob/master/src/dynamic_programming/word_break.rs) + * General + * [Convex Hull](https://github.com/TheAlgorithms/Rust/blob/master/src/general/convex_hull.rs) + * [Fisher Yates Shuffle](https://github.com/TheAlgorithms/Rust/blob/master/src/general/fisher_yates_shuffle.rs) + * [Genetic](https://github.com/TheAlgorithms/Rust/blob/master/src/general/genetic.rs) + * [Hanoi](https://github.com/TheAlgorithms/Rust/blob/master/src/general/hanoi.rs) + * [Huffman Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/general/huffman_encoding.rs) + * [Kadane Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kadane_algorithm.rs) + * [Kmeans](https://github.com/TheAlgorithms/Rust/blob/master/src/general/kmeans.rs) + * [Mex](https://github.com/TheAlgorithms/Rust/blob/master/src/general/mex.rs) + * Permutations + * [Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/heap.rs) + * [Naive](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/naive.rs) + * [Steinhaus Johnson Trotter](https://github.com/TheAlgorithms/Rust/blob/master/src/general/permutations/steinhaus_johnson_trotter.rs) + * [Two Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/general/two_sum.rs) + * Geometry + * [Closest Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/closest_points.rs) + * [Graham Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/graham_scan.rs) + * [Jarvis Scan](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/jarvis_scan.rs) + * [Point](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/point.rs) + * [Polygon Points](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/polygon_points.rs) + * [Ramer Douglas Peucker](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/ramer_douglas_peucker.rs) + * [Segment](https://github.com/TheAlgorithms/Rust/blob/master/src/geometry/segment.rs) + * Graph + * [Astar](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/astar.rs) + * [Bellman Ford](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bellman_ford.rs) + * [Bipartite Matching](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/bipartite_matching.rs) + * [Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/breadth_first_search.rs) + * [Centroid Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/centroid_decomposition.rs) + * [Decremental Connectivity](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/decremental_connectivity.rs) + * [Depth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search.rs) + * [Depth First Search Tic Tac Toe](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/depth_first_search_tic_tac_toe.rs) + * [Detect Cycle](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/detect_cycle.rs) + * [Dijkstra](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dijkstra.rs) + * [Dinic Maxflow](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/dinic_maxflow.rs) + * [Disjoint Set Union](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/disjoint_set_union.rs) + * [Eulerian Path](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/eulerian_path.rs) + * [Floyd Warshall](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/floyd_warshall.rs) + * [Ford Fulkerson](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/ford_fulkerson.rs) + * [Graph Enumeration](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/graph_enumeration.rs) + * [Heavy Light Decomposition](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/heavy_light_decomposition.rs) + * [Kosaraju](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/kosaraju.rs) + * [Lee Breadth First Search](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lee_breadth_first_search.rs) + * [Lowest Common Ancestor](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/lowest_common_ancestor.rs) + * [Minimum Spanning Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/minimum_spanning_tree.rs) + * [Prim](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prim.rs) + * [Prufer Code](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/prufer_code.rs) + * [Strongly Connected Components](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/strongly_connected_components.rs) + * [Tarjans Ssc](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/tarjans_ssc.rs) + * [Topological Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/topological_sort.rs) + * [Two Satisfiability](https://github.com/TheAlgorithms/Rust/blob/master/src/graph/two_satisfiability.rs) + * [Lib](https://github.com/TheAlgorithms/Rust/blob/master/src/lib.rs) + * Machine Learning + * [Cholesky](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/cholesky.rs) + * [K Means](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/k_means.rs) + * [Linear Regression](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/linear_regression.rs) + * Loss Function + * [Hinge Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/hinge_loss.rs) + * [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/huber_loss.rs) + * [Kl Divergence Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/kl_divergence_loss.rs) + * [Mean Absolute Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_absolute_error_loss.rs) + * [Mean Squared Error Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/mean_squared_error_loss.rs) + * [Negative Log Likelihood Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/loss_function/negative_log_likelihood.rs) + * Optimization + * [Adam](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/adam.rs) + * [Gradient Descent](https://github.com/TheAlgorithms/Rust/blob/master/src/machine_learning/optimization/gradient_descent.rs) + * Math + * [Abs](https://github.com/TheAlgorithms/Rust/blob/master/src/math/abs.rs) + * [Aliquot Sum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/aliquot_sum.rs) + * [Amicable Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/amicable_numbers.rs) + * [Area Of Polygon](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_of_polygon.rs) + * [Area Under Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/area_under_curve.rs) + * [Armstrong Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/armstrong_number.rs) + * [Average](https://github.com/TheAlgorithms/Rust/blob/master/src/math/average.rs) + * [Baby Step Giant Step](https://github.com/TheAlgorithms/Rust/blob/master/src/math/baby_step_giant_step.rs) + * [Bell Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/bell_numbers.rs) + * [Binary Exponentiation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binary_exponentiation.rs) + * [Binomial Coefficient](https://github.com/TheAlgorithms/Rust/blob/master/src/math/binomial_coefficient.rs) + * [Catalan Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/catalan_numbers.rs) + * [Ceil](https://github.com/TheAlgorithms/Rust/blob/master/src/math/ceil.rs) + * [Chinese Remainder Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/chinese_remainder_theorem.rs) + * [Collatz Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/collatz_sequence.rs) + * [Combinations](https://github.com/TheAlgorithms/Rust/blob/master/src/math/combinations.rs) + * [Cross Entropy Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/cross_entropy_loss.rs) + * [Decimal To Fraction](https://github.com/TheAlgorithms/Rust/blob/master/src/math/decimal_to_fraction.rs) + * [Doomsday](https://github.com/TheAlgorithms/Rust/blob/master/src/math/doomsday.rs) + * [Elliptic Curve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/elliptic_curve.rs) + * [Euclidean Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/math/euclidean_distance.rs) + * [Exponential Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/exponential_linear_unit.rs) + * [Extended Euclidean Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/extended_euclidean_algorithm.rs) + * [Factorial](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factorial.rs) + * [Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/factors.rs) + * [Fast Fourier Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_fourier_transform.rs) + * [Fast Power](https://github.com/TheAlgorithms/Rust/blob/master/src/math/fast_power.rs) + * [Faster Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/faster_perfect_numbers.rs) + * [Field](https://github.com/TheAlgorithms/Rust/blob/master/src/math/field.rs) + * [Frizzy Number](https://github.com/TheAlgorithms/Rust/blob/master/src/math/frizzy_number.rs) + * [Gaussian Elimination](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_elimination.rs) + * [Gaussian Error Linear Unit](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gaussian_error_linear_unit.rs) + * [Gcd Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/gcd_of_n_numbers.rs) + * [Geometric Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/geometric_series.rs) + * [Greatest Common Divisor](https://github.com/TheAlgorithms/Rust/blob/master/src/math/greatest_common_divisor.rs) + * [Huber Loss](https://github.com/TheAlgorithms/Rust/blob/master/src/math/huber_loss.rs) + * [Interest](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interest.rs) + * [Interpolation](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interpolation.rs) + * [Interquartile Range](https://github.com/TheAlgorithms/Rust/blob/master/src/math/interquartile_range.rs) + * [Karatsuba Multiplication](https://github.com/TheAlgorithms/Rust/blob/master/src/math/karatsuba_multiplication.rs) + * [Lcm Of N Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lcm_of_n_numbers.rs) + * [Leaky Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/leaky_relu.rs) + * [Least Square Approx](https://github.com/TheAlgorithms/Rust/blob/master/src/math/least_square_approx.rs) + * [Linear Sieve](https://github.com/TheAlgorithms/Rust/blob/master/src/math/linear_sieve.rs) + * [Logarithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/logarithm.rs) + * [Lucas Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/lucas_series.rs) + * [Matrix Ops](https://github.com/TheAlgorithms/Rust/blob/master/src/math/matrix_ops.rs) + * [Mersenne Primes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/mersenne_primes.rs) + * [Miller Rabin](https://github.com/TheAlgorithms/Rust/blob/master/src/math/miller_rabin.rs) + * [Modular Exponential](https://github.com/TheAlgorithms/Rust/blob/master/src/math/modular_exponential.rs) + * [Newton Raphson](https://github.com/TheAlgorithms/Rust/blob/master/src/math/newton_raphson.rs) + * [Nthprime](https://github.com/TheAlgorithms/Rust/blob/master/src/math/nthprime.rs) + * [Pascal Triangle](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pascal_triangle.rs) + * [Perfect Cube](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_cube.rs) + * [Perfect Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_numbers.rs) + * [Perfect Square](https://github.com/TheAlgorithms/Rust/blob/master/src/math/perfect_square.rs) + * [Pollard Rho](https://github.com/TheAlgorithms/Rust/blob/master/src/math/pollard_rho.rs) + * [Prime Check](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_check.rs) + * [Prime Factors](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_factors.rs) + * [Prime Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/prime_numbers.rs) + * [Quadratic Residue](https://github.com/TheAlgorithms/Rust/blob/master/src/math/quadratic_residue.rs) + * [Random](https://github.com/TheAlgorithms/Rust/blob/master/src/math/random.rs) + * [Relu](https://github.com/TheAlgorithms/Rust/blob/master/src/math/relu.rs) + * [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sieve_of_eratosthenes.rs) + * [Sigmoid](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sigmoid.rs) + * [Signum](https://github.com/TheAlgorithms/Rust/blob/master/src/math/signum.rs) + * [Simpsons Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/simpsons_integration.rs) + * [Softmax](https://github.com/TheAlgorithms/Rust/blob/master/src/math/softmax.rs) + * [Sprague Grundy Theorem](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sprague_grundy_theorem.rs) + * [Square Pyramidal Numbers](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_pyramidal_numbers.rs) + * [Square Root](https://github.com/TheAlgorithms/Rust/blob/master/src/math/square_root.rs) + * [Sum Of Digits](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_digits.rs) + * [Sum Of Geometric Progression](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_geometric_progression.rs) + * [Sum Of Harmonic Series](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sum_of_harmonic_series.rs) + * [Sylvester Sequence](https://github.com/TheAlgorithms/Rust/blob/master/src/math/sylvester_sequence.rs) + * [Tanh](https://github.com/TheAlgorithms/Rust/blob/master/src/math/tanh.rs) + * [Trapezoidal Integration](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trapezoidal_integration.rs) + * [Trial Division](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trial_division.rs) + * [Trig Functions](https://github.com/TheAlgorithms/Rust/blob/master/src/math/trig_functions.rs) + * [Vector Cross Product](https://github.com/TheAlgorithms/Rust/blob/master/src/math/vector_cross_product.rs) + * [Zellers Congruence Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/math/zellers_congruence_algorithm.rs) + * Navigation + * [Bearing](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/bearing.rs) + * [Haversine](https://github.com/TheAlgorithms/Rust/blob/master/src/navigation/haversine.rs) + * Number Theory + * [Compute Totient](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/compute_totient.rs) + * [Kth Factor](https://github.com/TheAlgorithms/Rust/blob/master/src/number_theory/kth_factor.rs) + * Searching + * [Binary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search.rs) + * [Binary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/binary_search_recursive.rs) + * [Exponential Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/exponential_search.rs) + * [Fibonacci Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/fibonacci_search.rs) + * [Interpolation Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/interpolation_search.rs) + * [Jump Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/jump_search.rs) + * [Kth Smallest](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest.rs) + * [Kth Smallest Heap](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/kth_smallest_heap.rs) + * [Linear Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/linear_search.rs) + * [Moore Voting](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/moore_voting.rs) + * [Quick Select](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/quick_select.rs) + * [Saddleback Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/saddleback_search.rs) + * [Ternary Search](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search.rs) + * [Ternary Search Min Max](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max.rs) + * [Ternary Search Min Max Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_min_max_recursive.rs) + * [Ternary Search Recursive](https://github.com/TheAlgorithms/Rust/blob/master/src/searching/ternary_search_recursive.rs) + * Sorting + * [Bead Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bead_sort.rs) + * [Binary Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/binary_insertion_sort.rs) + * [Bingo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bingo_sort.rs) + * [Bitonic Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bitonic_sort.rs) + * [Bogo Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bogo_sort.rs) + * [Bubble Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bubble_sort.rs) + * [Bucket Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/bucket_sort.rs) + * [Cocktail Shaker Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cocktail_shaker_sort.rs) + * [Comb Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/comb_sort.rs) + * [Counting Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/counting_sort.rs) + * [Cycle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/cycle_sort.rs) + * [Dutch National Flag Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/dutch_national_flag_sort.rs) + * [Exchange Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/exchange_sort.rs) + * [Gnome Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/gnome_sort.rs) + * [Heap Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/heap_sort.rs) + * [Insertion Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/insertion_sort.rs) + * [Intro Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/intro_sort.rs) + * [Merge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/merge_sort.rs) + * [Odd Even Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/odd_even_sort.rs) + * [Pancake Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pancake_sort.rs) + * [Patience Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/patience_sort.rs) + * [Pigeonhole Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/pigeonhole_sort.rs) + * [Quick Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort.rs) + * [Quick Sort 3_ways](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/quick_sort_3_ways.rs) + * [Radix Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/radix_sort.rs) + * [Selection Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/selection_sort.rs) + * [Shell Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/shell_sort.rs) + * [Sleep Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sleep_sort.rs) + * [Sort Utils](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/sort_utils.rs) + * [Stooge Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/stooge_sort.rs) + * [Tim Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tim_sort.rs) + * [Tree Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/tree_sort.rs) + * [Wave Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wave_sort.rs) + * [Wiggle Sort](https://github.com/TheAlgorithms/Rust/blob/master/src/sorting/wiggle_sort.rs) + * String + * [Aho Corasick](https://github.com/TheAlgorithms/Rust/blob/master/src/string/aho_corasick.rs) + * [Anagram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/anagram.rs) + * [Autocomplete Using Trie](https://github.com/TheAlgorithms/Rust/blob/master/src/string/autocomplete_using_trie.rs) + * [Boyer Moore Search](https://github.com/TheAlgorithms/Rust/blob/master/src/string/boyer_moore_search.rs) + * [Burrows Wheeler Transform](https://github.com/TheAlgorithms/Rust/blob/master/src/string/burrows_wheeler_transform.rs) + * [Duval Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/duval_algorithm.rs) + * [Hamming Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/hamming_distance.rs) + * [Isomorphism](https://github.com/TheAlgorithms/Rust/blob/master/src/string/isomorphism.rs) + * [Jaro Winkler Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/jaro_winkler_distance.rs) + * [Knuth Morris Pratt](https://github.com/TheAlgorithms/Rust/blob/master/src/string/knuth_morris_pratt.rs) + * [Levenshtein Distance](https://github.com/TheAlgorithms/Rust/blob/master/src/string/levenshtein_distance.rs) + * [Lipogram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/lipogram.rs) + * [Manacher](https://github.com/TheAlgorithms/Rust/blob/master/src/string/manacher.rs) + * [Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/palindrome.rs) + * [Pangram](https://github.com/TheAlgorithms/Rust/blob/master/src/string/pangram.rs) + * [Rabin Karp](https://github.com/TheAlgorithms/Rust/blob/master/src/string/rabin_karp.rs) + * [Reverse](https://github.com/TheAlgorithms/Rust/blob/master/src/string/reverse.rs) + * [Run Length Encoding](https://github.com/TheAlgorithms/Rust/blob/master/src/string/run_length_encoding.rs) + * [Shortest Palindrome](https://github.com/TheAlgorithms/Rust/blob/master/src/string/shortest_palindrome.rs) + * [Suffix Array](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array.rs) + * [Suffix Array Manber Myers](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_array_manber_myers.rs) + * [Suffix Tree](https://github.com/TheAlgorithms/Rust/blob/master/src/string/suffix_tree.rs) + * [Z Algorithm](https://github.com/TheAlgorithms/Rust/blob/master/src/string/z_algorithm.rs) From 55f1d18a89224e146599b896a8a56f36049a8892 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Wed, 3 Jul 2024 12:19:37 +0200 Subject: [PATCH 15/22] Fix: removed an innecesary condition --- src/machine_learning/loss_function/negative_log_likelihood.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index cea3c3c6de1..b554149bd7e 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -17,7 +17,7 @@ pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { // Checks if the length of the actual and predicted values are equal - if y_true.len() != y_pred.len() || y_pred.is_empty() || y_true.is_empty() { + if y_true.len() != y_pred.len() || y_pred.is_empty() { return None; } // Checks values are between 0 and 1 From 8ef77e8925b7a71cefb77d901627a4282c372fc9 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Wed, 3 Jul 2024 12:44:45 +0200 Subject: [PATCH 16/22] Fix: changed return type to Result instead of Option --- .../loss_function/negative_log_likelihood.rs | 57 +++++++++++++++---- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index b554149bd7e..53f38c9fb2b 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -15,14 +15,21 @@ // // https://towardsdatascience.com/cross-entropy-negative-log-likelihood-and-all-that-jazz-47a95bd2e81 -pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { +pub fn neg_log_likelihood( + y_true: &[f64], + y_pred: &[f64], +) -> Result { // Checks if the length of the actual and predicted values are equal - if y_true.len() != y_pred.len() || y_pred.is_empty() { - return None; + if y_true.len() != y_pred.len() { + return Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength); + } + // Checks if the inputs are empty + if y_pred.is_empty() { + return Err(NegativeLogLikelihoodLossError::EmptyInputs); } // Checks values are between 0 and 1 if !are_all_values_in_range(y_true) || !are_all_values_in_range(y_pred) { - return None; + return Err(NegativeLogLikelihoodLossError::InvalidValues); } let mut total_loss: f64 = 0.0; @@ -30,7 +37,14 @@ pub fn neg_log_likelihood(y_true: &[f64], y_pred: &[f64]) -> Option { let loss: f64 = -a * p.ln() - (1.0 - a) * (1.0 - p).ln(); total_loss += loss; } - Some(total_loss / (y_pred.len() as f64)) + Ok(total_loss / (y_pred.len() as f64)) +} + +#[derive(Debug, PartialEq, Eq)] +pub enum NegativeLogLikelihoodLossError { + InputsHaveDifferentLength, + EmptyInputs, + InvalidValues, } fn are_all_values_in_range(values: &[f64]) -> bool { @@ -39,6 +53,7 @@ fn are_all_values_in_range(values: &[f64]) -> bool { #[cfg(test)] mod tests { + use super::*; #[test] @@ -47,7 +62,7 @@ mod tests { let predicted_values: Vec = vec![0.9, 0.1, 0.8]; assert_eq!( neg_log_likelihood(&actual_values, &predicted_values), - Some(0.14462152754328741) + Ok(0.14462152754328741) ); } @@ -55,41 +70,59 @@ mod tests { fn test_neg_log_likelihood_invalid_length0() { let actual_values: Vec = vec![1.0, 0.0, 1.0]; let predicted_values: Vec = vec![0.9, 0.1]; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength) + ); } #[test] fn test_neg_log_likelihood_invalid_length1() { let actual_values: Vec = vec![1.0, 0.0]; let predicted_values: Vec = vec![0.9, 0.1, 0.8]; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength) + ); } #[test] fn test_neg_log_likelihood_invalid_values() { let actual_values: Vec = vec![1.0, 0.0, 1.0]; let predicted_values: Vec = vec![1.1, 0.1, 0.8]; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + Err(NegativeLogLikelihoodLossError::InvalidValues) + ); } #[test] fn test_neg_log_likelihood_empty_prediction() { let actual_values: Vec = vec![1.0, 0.0, 1.0]; let predicted_values: Vec = vec![]; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + Err(NegativeLogLikelihoodLossError::EmptyInputs) + ); } #[test] fn test_neg_log_likelihood_negative_values0() { let actual_values: Vec = vec![-1.0, 0.0, 1.0]; let predicted_values: Vec = vec![0.9, 0.1, 0.8]; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + Err(NegativeLogLikelihoodLossError::InvalidValues) + ); } #[test] fn test_neg_log_likelihood_negative_values1() { let actual_values: Vec = vec![1.0, 0.0, 1.0]; let predicted_values: Vec = vec![0.9, 0.1, -0.8]; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values), None); + assert_eq!( + neg_log_likelihood(&actual_values, &predicted_values), + Err(NegativeLogLikelihoodLossError::InvalidValues) + ); } } From e11b6e0bcf9104dd8dbd6e20efa6b07cb09591bf Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Wed, 3 Jul 2024 12:57:48 +0200 Subject: [PATCH 17/22] Fix: fixed test and moved position of if statements --- .../loss_function/negative_log_likelihood.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 53f38c9fb2b..67f7b4e82c2 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -19,14 +19,14 @@ pub fn neg_log_likelihood( y_true: &[f64], y_pred: &[f64], ) -> Result { + // Checks if the inputs are empty + if y_pred.is_empty() || y_true.is_empty() { + return Err(NegativeLogLikelihoodLossError::EmptyInputs); + } // Checks if the length of the actual and predicted values are equal if y_true.len() != y_pred.len() { return Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength); } - // Checks if the inputs are empty - if y_pred.is_empty() { - return Err(NegativeLogLikelihoodLossError::EmptyInputs); - } // Checks values are between 0 and 1 if !are_all_values_in_range(y_true) || !are_all_values_in_range(y_pred) { return Err(NegativeLogLikelihoodLossError::InvalidValues); From abd523a4cb373c7494223debcd5afd8bfe49f9a9 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Thu, 4 Jul 2024 17:44:30 +0200 Subject: [PATCH 18/22] Feat: added suggestions and removed one condition --- .../loss_function/negative_log_likelihood.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 67f7b4e82c2..8d53b679521 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -20,13 +20,13 @@ pub fn neg_log_likelihood( y_pred: &[f64], ) -> Result { // Checks if the inputs are empty - if y_pred.is_empty() || y_true.is_empty() { - return Err(NegativeLogLikelihoodLossError::EmptyInputs); - } - // Checks if the length of the actual and predicted values are equal if y_true.len() != y_pred.len() { return Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength); } + // Checks if the length of the actual and predicted values are equal + if y_pred.is_empty() { + return Err(NegativeLogLikelihoodLossError::EmptyInputs); + } // Checks values are between 0 and 1 if !are_all_values_in_range(y_true) || !are_all_values_in_range(y_pred) { return Err(NegativeLogLikelihoodLossError::InvalidValues); From d1dff79985b63525da160d9a3acc49739d79dc61 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Thu, 4 Jul 2024 18:13:09 +0200 Subject: [PATCH 19/22] Tests: added suggestion to use a macro for testing purposes --- .../loss_function/negative_log_likelihood.rs | 102 ++++++------------ 1 file changed, 33 insertions(+), 69 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 8d53b679521..3fbc9639c16 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -51,78 +51,42 @@ fn are_all_values_in_range(values: &[f64]) -> bool { values.iter().all(|&x| (0.0..=1.0).contains(&x)) } -#[cfg(test)] -mod tests { - - use super::*; - - #[test] - fn test_neg_log_likelihood() { - let actual_values: Vec = vec![1.0, 0.0, 1.0]; - let predicted_values: Vec = vec![0.9, 0.1, 0.8]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Ok(0.14462152754328741) - ); - } - - #[test] - fn test_neg_log_likelihood_invalid_length0() { - let actual_values: Vec = vec![1.0, 0.0, 1.0]; - let predicted_values: Vec = vec![0.9, 0.1]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength) - ); - } - - #[test] - fn test_neg_log_likelihood_invalid_length1() { - let actual_values: Vec = vec![1.0, 0.0]; - let predicted_values: Vec = vec![0.9, 0.1, 0.8]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength) - ); - } - - #[test] - fn test_neg_log_likelihood_invalid_values() { - let actual_values: Vec = vec![1.0, 0.0, 1.0]; - let predicted_values: Vec = vec![1.1, 0.1, 0.8]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Err(NegativeLogLikelihoodLossError::InvalidValues) - ); +macro_rules! test_with_wrong_inputs { + ($($name:ident: $inputs:expr,)*) => { + $( + #[test] + fn $name() { + let (values_a, values_b, expected_error) = $inputs; + assert_eq!(neg_log_likelihood(&values_a, &values_b), expected_error); + assert_eq!(neg_log_likelihood(&values_b, &values_a), expected_error); + } + )* } +} +test_with_wrong_inputs! { + different_length: (vec![0.9, 0.0, 0.8], vec![0.9, 0.1], Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength)), + different_length_one_empty: (vec![], vec![0.9, 0.1], Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength)), + value_greater_than_1: (vec![1.1, 0.0, 0.8], vec![0.1, 0.2, 0.3], Err(NegativeLogLikelihoodLossError::InvalidValues)), + value_greater_smaller_than_0: (vec![0.9, 0.0, -0.1], vec![0.1, 0.2, 0.3], Err(NegativeLogLikelihoodLossError::InvalidValues)), + empty_input: (vec![], vec![], Err(NegativeLogLikelihoodLossError::EmptyInputs)), +} - #[test] - fn test_neg_log_likelihood_empty_prediction() { - let actual_values: Vec = vec![1.0, 0.0, 1.0]; - let predicted_values: Vec = vec![]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Err(NegativeLogLikelihoodLossError::EmptyInputs) - ); +macro_rules! test_neg_log_likelihood { + ($($name:ident: $inputs:expr,)*) => { + $( + #[test] + fn $name() { + let (actual_values, predicted_values, expected) = $inputs; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values).unwrap(), expected); + } + )* } +} - #[test] - fn test_neg_log_likelihood_negative_values0() { - let actual_values: Vec = vec![-1.0, 0.0, 1.0]; - let predicted_values: Vec = vec![0.9, 0.1, 0.8]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Err(NegativeLogLikelihoodLossError::InvalidValues) - ); - } +test_neg_log_likelihood! { + set_0: (vec![1.0, 0.0, 1.0], vec![0.9, 0.1, 0.8], 0.14462152754328741), + set_1: (vec![1.0, 0.0, 1.0], vec![0.1, 0.2, 0.3], 1.2432338162113972), + set_2: (vec![0.0, 1.0, 0.0], vec![0.1, 0.2, 0.3], 0.6904911240102196), - #[test] - fn test_neg_log_likelihood_negative_values1() { - let actual_values: Vec = vec![1.0, 0.0, 1.0]; - let predicted_values: Vec = vec![0.9, 0.1, -0.8]; - assert_eq!( - neg_log_likelihood(&actual_values, &predicted_values), - Err(NegativeLogLikelihoodLossError::InvalidValues) - ); - } + set_3: (vec![1.0, 0.0, 1.0, 0.0], vec![0.9, 0.1, 0.8, 0.2], 0.164252033486018), } From 171ef934f6a93bbfccafa22c8b2c7dfd47f05527 Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Thu, 4 Jul 2024 18:18:20 +0200 Subject: [PATCH 20/22] Fix: fixed clippy issue and wrapped tests --- .../loss_function/negative_log_likelihood.rs | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 3fbc9639c16..9917a69a477 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -51,42 +51,48 @@ fn are_all_values_in_range(values: &[f64]) -> bool { values.iter().all(|&x| (0.0..=1.0).contains(&x)) } -macro_rules! test_with_wrong_inputs { - ($($name:ident: $inputs:expr,)*) => { - $( - #[test] - fn $name() { - let (values_a, values_b, expected_error) = $inputs; - assert_eq!(neg_log_likelihood(&values_a, &values_b), expected_error); - assert_eq!(neg_log_likelihood(&values_b, &values_a), expected_error); - } - )* +#[cfg(test)] +mod tests { + use super::*; + + macro_rules! test_with_wrong_inputs { + ($($name:ident: $inputs:expr,)*) => { + $( + #[test] + fn $name() { + let (values_a, values_b, expected_error) = $inputs; + assert_eq!(neg_log_likelihood(&values_a, &values_b), expected_error); + assert_eq!(neg_log_likelihood(&values_b, &values_a), expected_error); + } + )* + } } -} -test_with_wrong_inputs! { - different_length: (vec![0.9, 0.0, 0.8], vec![0.9, 0.1], Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength)), - different_length_one_empty: (vec![], vec![0.9, 0.1], Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength)), - value_greater_than_1: (vec![1.1, 0.0, 0.8], vec![0.1, 0.2, 0.3], Err(NegativeLogLikelihoodLossError::InvalidValues)), - value_greater_smaller_than_0: (vec![0.9, 0.0, -0.1], vec![0.1, 0.2, 0.3], Err(NegativeLogLikelihoodLossError::InvalidValues)), - empty_input: (vec![], vec![], Err(NegativeLogLikelihoodLossError::EmptyInputs)), -} -macro_rules! test_neg_log_likelihood { - ($($name:ident: $inputs:expr,)*) => { - $( - #[test] - fn $name() { - let (actual_values, predicted_values, expected) = $inputs; - assert_eq!(neg_log_likelihood(&actual_values, &predicted_values).unwrap(), expected); - } - )* + test_with_wrong_inputs! { + different_length: (vec![0.9, 0.0, 0.8], vec![0.9, 0.1], Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength)), + different_length_one_empty: (vec![], vec![0.9, 0.1], Err(NegativeLogLikelihoodLossError::InputsHaveDifferentLength)), + value_greater_than_1: (vec![1.1, 0.0, 0.8], vec![0.1, 0.2, 0.3], Err(NegativeLogLikelihoodLossError::InvalidValues)), + value_greater_smaller_than_0: (vec![0.9, 0.0, -0.1], vec![0.1, 0.2, 0.3], Err(NegativeLogLikelihoodLossError::InvalidValues)), + empty_input: (vec![], vec![], Err(NegativeLogLikelihoodLossError::EmptyInputs)), } -} -test_neg_log_likelihood! { - set_0: (vec![1.0, 0.0, 1.0], vec![0.9, 0.1, 0.8], 0.14462152754328741), - set_1: (vec![1.0, 0.0, 1.0], vec![0.1, 0.2, 0.3], 1.2432338162113972), - set_2: (vec![0.0, 1.0, 0.0], vec![0.1, 0.2, 0.3], 0.6904911240102196), + macro_rules! test_neg_log_likelihood { + ($($name:ident: $inputs:expr,)*) => { + $( + #[test] + fn $name() { + let (actual_values, predicted_values, expected) = $inputs; + assert_eq!(neg_log_likelihood(&actual_values, &predicted_values).unwrap(), expected); + } + )* + } + } + + test_neg_log_likelihood! { + set_0: (vec![1.0, 0.0, 1.0], vec![0.9, 0.1, 0.8], 0.14462152754328741), + set_1: (vec![1.0, 0.0, 1.0], vec![0.1, 0.2, 0.3], 1.2432338162113972), + set_2: (vec![0.0, 1.0, 0.0], vec![0.1, 0.2, 0.3], 0.6904911240102196), - set_3: (vec![1.0, 0.0, 1.0, 0.0], vec![0.9, 0.1, 0.8, 0.2], 0.164252033486018), + set_3: (vec![1.0, 0.0, 1.0, 0.0], vec![0.9, 0.1, 0.8, 0.2], 0.164252033486018), + } } From 7771e439ecb94d85ea15c2c18a3ee2be5615b8fe Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Fri, 5 Jul 2024 00:23:27 +0200 Subject: [PATCH 21/22] Docs: added more documentation for the binary problem --- src/machine_learning/loss_function/negative_log_likelihood.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index 9917a69a477..ca7d944842b 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -14,6 +14,9 @@ // elements. // // https://towardsdatascience.com/cross-entropy-negative-log-likelihood-and-all-that-jazz-47a95bd2e81 +// http://neuralnetworksanddeeplearning.com/chap3.html +// Derivation of the formula: +// https://medium.com/@bhardwajprakarsh/negative-log-likelihood-loss-why-do-we-use-it-for-binary-classification-7625f9e3c944 pub fn neg_log_likelihood( y_true: &[f64], From 555b3fb374b6ecb90eaa21fb500b5fae290ddcc5 Mon Sep 17 00:00:00 2001 From: Piotr Idzik <65706193+vil02@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:24:27 +0200 Subject: [PATCH 22/22] style: remove blank line --- src/machine_learning/loss_function/negative_log_likelihood.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/machine_learning/loss_function/negative_log_likelihood.rs b/src/machine_learning/loss_function/negative_log_likelihood.rs index ca7d944842b..4fa633091cf 100644 --- a/src/machine_learning/loss_function/negative_log_likelihood.rs +++ b/src/machine_learning/loss_function/negative_log_likelihood.rs @@ -95,7 +95,6 @@ mod tests { set_0: (vec![1.0, 0.0, 1.0], vec![0.9, 0.1, 0.8], 0.14462152754328741), set_1: (vec![1.0, 0.0, 1.0], vec![0.1, 0.2, 0.3], 1.2432338162113972), set_2: (vec![0.0, 1.0, 0.0], vec![0.1, 0.2, 0.3], 0.6904911240102196), - set_3: (vec![1.0, 0.0, 1.0, 0.0], vec![0.9, 0.1, 0.8, 0.2], 0.164252033486018), } }