Clarify comments
This commit is contained in:
parent
e9c9396f77
commit
3942628566
14
src/main.rs
14
src/main.rs
@ -4,8 +4,8 @@ mod quick_sort;
|
|||||||
mod ssc;
|
mod ssc;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
use std::cmp::min;
|
|
||||||
use crate::util::read_to_graph;
|
use crate::util::read_to_graph;
|
||||||
|
use std::cmp::min;
|
||||||
|
|
||||||
use crate::merge_sort::merge_sort_inversions;
|
use crate::merge_sort::merge_sort_inversions;
|
||||||
use crate::min_cut::min_cut;
|
use crate::min_cut::min_cut;
|
||||||
@ -27,11 +27,7 @@ fn c1a3() {
|
|||||||
let mut comp_acc: usize = 0;
|
let mut comp_acc: usize = 0;
|
||||||
quick_sort(&mut vec, &mut comp_acc);
|
quick_sort(&mut vec, &mut comp_acc);
|
||||||
println!("course 1 assignment 3: {:?}", comp_acc);
|
println!("course 1 assignment 3: {:?}", comp_acc);
|
||||||
/*
|
// 1: 162085, 2: 164123, 3: 138382
|
||||||
1: 162085
|
|
||||||
2: 164123
|
|
||||||
3: 138382
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
@ -45,18 +41,18 @@ fn c1a4() {
|
|||||||
smalles_min_cut = new_min_cut;
|
smalles_min_cut = new_min_cut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* 17 */
|
// 17
|
||||||
println!("course 1 assignment 4: {:?}", smalles_min_cut);
|
println!("course 1 assignment 4: {:?}", smalles_min_cut);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn c2a1() {
|
fn c2a1() {
|
||||||
// I have not checked in the graph file, because it has 70MB.
|
// I have not checked in the graph file, because it has 70MB. This is a tiny test example.
|
||||||
// let g = read_to_directed_graph("data/course_2_assignment_1.txt").unwrap();
|
|
||||||
let g = read_to_directed_graph("data/course_2_assignment_1_test.txt").unwrap();
|
let g = read_to_directed_graph("data/course_2_assignment_1_test.txt").unwrap();
|
||||||
let sizes = ssc(g.0, g.1);
|
let sizes = ssc(g.0, g.1);
|
||||||
let max_size = min(sizes.len(), 5);
|
let max_size = min(sizes.len(), 5);
|
||||||
println!("{:?}", &sizes[0..max_size]);
|
println!("{:?}", &sizes[0..max_size]);
|
||||||
|
// [434821, 968, 459, 313, 211]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user