Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/ciphers/diffie_hellman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ mod tests {
let _bob_private = bob.get_private_key();
let bob_public = bob.generate_public_key();

// generating shared key using the struct implemenations
// generating shared key using the struct implementations
let alice_shared = alice.generate_shared_key(bob_public.as_str()).unwrap();
let bob_shared = bob.generate_shared_key(alice_public.as_str()).unwrap();
assert_eq!(alice_shared, bob_shared);
Expand Down
2 changes: 1 addition & 1 deletion src/data_structures/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ mod tests {

assert_eq!(list.length, 100);

// Ensure numbers were adderd back and we're able to traverse nodes
// Ensure numbers were added back and we're able to traverse nodes
if let Some(val) = list.get(78) {
assert_eq!(*val, 78);
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/general/kmeans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ macro_rules! impl_kmeans {
pub fn kmeans(xs: Vec<Vec<$kind>>, k: usize) -> Vec<usize> {
assert!(xs.len() >= k);

// Rather than pulling in a dependency to radomly select the staring
// points for the centroids, we're going to deterministally choose them by
// slecting evenly spaced points in `xs`
// Rather than pulling in a dependency to randomly select the staring
// points for the centroids, we're going to deterministically choose them by
// selecting evenly spaced points in `xs`
let n_per_cluster: usize = xs.len() / k;
let centroids: Vec<Vec<$kind>> =
(0..k).map(|j| xs[j * n_per_cluster].clone()).collect();
Expand Down
6 changes: 3 additions & 3 deletions src/graph/decremental_connectivity.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::collections::HashSet;

/// A data-structure that, given a forest, allows dynamic-connectivity queries.
/// Meaning deletion of an edge (u,v) and checking whether two vertecies are still connected.
/// Meaning deletion of an edge (u,v) and checking whether two vertices are still connected.
///
/// # Complexity
/// The preprocessing phase runs in O(n) time, where n is the number of vertecies in the forest.
/// The preprocessing phase runs in O(n) time, where n is the number of vertices in the forest.
/// Deletion runs in O(log n) and checking for connectivity runs in O(1) time.
///
/// # Sources
Expand Down Expand Up @@ -162,7 +162,7 @@ fn has_cycle(
mod tests {
use std::collections::HashSet;

// test forest (remember the assumptoin that roots are adjacent to themselves)
// test forest (remember the assumption that roots are adjacent to themselves)
// _ _
// \ / \ /
// 0 7
Expand Down
2 changes: 1 addition & 1 deletion src/math/amicable_numbers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Operations based around amicable numbers
// Suports u32 but should be interchangable with other types
// Supports u32 but should be interchangable with other types
// Wikipedia reference: https://en.wikipedia.org/wiki/Amicable_numbers

// Returns vec of amicable pairs below N
Expand Down