Skip to content

Commit 24c67c0

Browse files
authored
Remove debug statements (#41)
1 parent 4e4ae64 commit 24c67c0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sorting/counting_sort.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// O(n + maxval) in time, where maxval is the biggest value an input can possibly take
33
/// O(maxval) in memory
44
/// u32 is chosen arbitrarly, a counting sort probably should'nt be used on data that requires bigger types.
5-
use std::fmt::Debug;
5+
66
pub fn counting_sort(arr: &mut [u32], maxval: usize) {
77
let mut occurences: Vec<usize> = vec![0; maxval + 1];
88

@@ -21,7 +21,7 @@ pub fn counting_sort(arr: &mut [u32], maxval: usize) {
2121

2222
use std::ops::AddAssign;
2323
/// Generic implementation of a counting sort for all usigned types
24-
pub fn generic_counting_sort<T: Into<u64> + From<u8> + AddAssign + Copy + Debug>(
24+
pub fn generic_counting_sort<T: Into<u64> + From<u8> + AddAssign + Copy>(
2525
arr: &mut [T],
2626
maxval: usize,
2727
) {
@@ -69,10 +69,8 @@ mod test {
6969
}
7070
#[test]
7171
fn generic_counting_sort() {
72-
//descending u8
7372
let mut ve1: Vec<u8> = vec![100, 30, 60, 10, 20, 120, 1];
7473
super::generic_counting_sort(&mut ve1, 120);
75-
println!("{:?}", ve1);
7674
for i in 0..ve1.len() - 1 {
7775
assert!(ve1[i] <= ve1[i + 1]);
7876
}

0 commit comments

Comments
 (0)