master > master: code-rust - bsp
This commit is contained in:
		
							parent
							
								
									0dcc97cd6d
								
							
						
					
					
						commit
						2f600e01e3
					
				@ -2,14 +2,24 @@
 | 
				
			|||||||
// IMPORTS
 | 
					// IMPORTS
 | 
				
			||||||
// ----------------------------------------------------------------
 | 
					// ----------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern crate ads2;
 | 
					mod stacks;
 | 
				
			||||||
 | 
					mod core;
 | 
				
			||||||
 | 
					mod graphs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use ads2::core::utils;
 | 
					use graphs::graph::Graph;
 | 
				
			||||||
 | 
					use graphs::tarjan::tarjan_algorithm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ----------------------------------------------------------------
 | 
					// ----------------------------------------------------------------
 | 
				
			||||||
// MAIN METHOD
 | 
					// MAIN METHOD
 | 
				
			||||||
// ----------------------------------------------------------------
 | 
					// ----------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn main() {
 | 
					fn main() {
 | 
				
			||||||
    utils::greet();
 | 
					    let nodes: Vec<_> = vec![1,2,3,4,5,6,7];
 | 
				
			||||||
 | 
					    let edges: Vec<(_, _)> = vec![(1,2), (1,3), (2,3), (3,4), (4,5), (5,2), (5,6), (5,7), (6,7)];
 | 
				
			||||||
 | 
					    let gph = Graph::new(nodes, edges);
 | 
				
			||||||
 | 
					    let components = tarjan_algorithm(&gph);
 | 
				
			||||||
 | 
					    println!("Components:");
 | 
				
			||||||
 | 
					    for component in components {
 | 
				
			||||||
 | 
					        println!("{:?}", component);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user