Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] master from TheAlgorithms:master #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 1 commit into AlgorithmAndLeetCode:master from TheAlgorithms:master
Aug 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ manual_assert = { level = "allow", priority = 1 }
manual_let_else = { level = "allow", priority = 1 }
manual_string_new = { level = "allow", priority = 1 }
many_single_char_names = { level = "allow", priority = 1 }
match_on_vec_items = { level = "allow", priority = 1 }
match_wildcard_for_single_variants = { level = "allow", priority = 1 }
missing_errors_doc = { level = "allow", priority = 1 }
missing_fields_in_debug = { level = "allow", priority = 1 }
Expand All @@ -69,6 +68,7 @@ used_underscore_binding = { level = "allow", priority = 1 }
ref_option = { level = "allow", priority = 1 }
unnecessary_semicolon = { level = "allow", priority = 1 }
ignore_without_reason = { level = "allow", priority = 1 }
needless_for_each = { level = "allow", priority = 1 }
# restriction-lints:
absolute_paths = { level = "allow", priority = 1 }
arithmetic_side_effects = { level = "allow", priority = 1 }
Expand Down Expand Up @@ -169,3 +169,5 @@ doc_overindented_list_items = { level = "allow", priority = 1 }
# complexity-lints
precedence = { level = "allow", priority = 1 }
manual_div_ceil = { level = "allow", priority = 1 }
# perf-lints
cloned_ref_to_slice_refs = { level = "allow", priority = 1 }
4 changes: 2 additions & 2 deletions src/data_structures/avl_tree.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<T: Ord> AVLTree<T> {
}

/// Returns an iterator that visits the nodes in the tree in order.
fn node_iter(&self) -> NodeIter<T> {
fn node_iter(&self) -> NodeIter<'_, T> {
let cap = self.root.as_ref().map_or(0, |n| n.height);
let mut node_iter = NodeIter {
stack: Vec::with_capacity(cap),
Expand All @@ -100,7 +100,7 @@ impl<T: Ord> AVLTree<T> {
}

/// Returns an iterator that visits the values in the tree in ascending order.
pub fn iter(&self) -> Iter<T> {
pub fn iter(&self) -> Iter<'_, T> {
Iter {
node_iter: self.node_iter(),
}
Expand Down
2 changes: 1 addition & 1 deletion src/data_structures/binary_search_tree.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<T> BinarySearchTreeIter<'_, T>
where
T: Ord,
{
pub fn new(tree: &BinarySearchTree<T>) -> BinarySearchTreeIter<T> {
pub fn new(tree: &BinarySearchTree<T>) -> BinarySearchTreeIter<'_, T> {
let mut iter = BinarySearchTreeIter { stack: vec![tree] };
iter.stack_push_left();
iter
Expand Down
1 change: 1 addition & 0 deletions src/data_structures/probabilistic/bloom_filter.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub trait BloomFilter<Item: Hash> {
/// When looking for an item, we hash its value and retrieve the boolean at index `hash(item) % CAPACITY`
/// If it's `false` it's absolutely sure the item isn't present
/// If it's `true` the item may be present, or maybe another one produces the same hash
#[allow(dead_code)]
#[derive(Debug)]
struct BasicBloomFilter<const CAPACITY: usize> {
vec: [bool; CAPACITY],
Expand Down
4 changes: 2 additions & 2 deletions src/data_structures/treap.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<T: Ord> Treap<T> {
}

/// Returns an iterator that visits the nodes in the tree in order.
fn node_iter(&self) -> NodeIter<T> {
fn node_iter(&self) -> NodeIter<'_, T> {
let mut node_iter = NodeIter { stack: Vec::new() };
// Initialize stack with path to leftmost child
let mut child = &self.root;
Expand All @@ -97,7 +97,7 @@ impl<T: Ord> Treap<T> {
}

/// Returns an iterator that visits the values in the tree in ascending order.
pub fn iter(&self) -> Iter<T> {
pub fn iter(&self) -> Iter<'_, T> {
Iter {
node_iter: self.node_iter(),
}
Expand Down
2 changes: 1 addition & 1 deletion src/data_structures/veb_tree.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl VebTree {
self.max
}

pub fn iter(&self) -> VebTreeIter {
pub fn iter(&self) -> VebTreeIter<'_> {
VebTreeIter::new(self)
}

Expand Down
2 changes: 2 additions & 0 deletions src/general/genetic.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub trait SelectionStrategy<Rng: rand::Rng> {

/// A roulette wheel selection strategy
/// https://en.wikipedia.org/wiki/Fitness_proportionate_selection
#[allow(dead_code)]
pub struct RouletteWheel<Rng: rand::Rng> {
rng: Rng,
}
Expand Down Expand Up @@ -84,6 +85,7 @@ impl<Rng: rand::Rng> SelectionStrategy<Rng> for RouletteWheel<Rng> {
}
}

#[allow(dead_code)]
pub struct Tournament<const K: usize, Rng: rand::Rng> {
rng: Rng,
}
Expand Down
2 changes: 1 addition & 1 deletion src/math/random.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl PCG32 {
pub fn get_state(&self) -> u64 {
self.state
}
pub fn iter_mut(&mut self) -> IterMut {
pub fn iter_mut(&mut self) -> IterMut<'_> {
IterMut { pcg: self }
}
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /