master > master: code-rust - bsp

This commit is contained in:
RD 2022-04-08 07:27:10 +02:00
parent 0dcc97cd6d
commit 2f600e01e3
1 changed files with 13 additions and 3 deletions

View File

@ -2,14 +2,24 @@
// 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
// ----------------------------------------------------------------
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);
}
}