|
|
const STACK_SIZE: usize = 128 * 1024 * 1024; fn run() { //... } fn main() { let child = std::thread::Builder::new() .stack_size(STACK_SIZE) .spawn(run) .unwrap(); child.join().unwrap(); } This text helped me:) 1 2 1 4 1 3 2 4 2 3 3 4 3 5 5 6 5 8 8 7 7 6 6 8 Check if your solution works correctly with dense graphs This problem is easier than rating should be if you know the trick. Invariant: graph G is decomposable if and only if all the connected components of G has even number of edges. A tree is very easy to be decomposed. Creating a tree equivalent to each connected component will lead to the answer. Hope this help, Mick :) It helped me a lot, thank you! I read a proof of the fact that any connected graph with even number of edges is decomposable, but it was quite complicated and didn't allude at any good algorithm underneath. Your idea is much simpler and easier to proof |
|
|