Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousCI committed Mar 9, 2024
1 parent f7a9bf1 commit 9843f2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<!-- - [Logic Gates]() -->
<!-- - [Boolean Algebra]() -->
<!-- - [Combinatorial Circuits]() -->
<!-- <!-- - [Tristates, Muxes, Decoders]() --> -->
<!-- <!-- - [Timing]() --> -->
<!-- <!-- - [Tristates, Muxes, Decoders]() -->
<!-- <!-- - [Timing]() -->
<!-- - [Sequential Circuits]() -->
<!-- - [Finite State Machines]() -->
<!-- <!-- - [Timing]() --> -->
<!-- <!-- - [Timing]() -->
<!-- - [Arithmetic Circuits]() -->
<!-- - [Memory Arrays]() -->
<!-- - [Logic Arrays]() -->
Expand Down Expand Up @@ -72,12 +72,12 @@
- [Dictionaries]()
- [Binary Search Tree]()
- [Red-Black Tree](./algorithms/rbtree.md)

<!-- - [Calculus I +]() -->
<!-- - [Series]() -->
<!-- - [Integrals]() -->
<!-- - [Differential Equations]() -->


# II year

<!-- - [Algebra]() -->
Expand Down Expand Up @@ -114,6 +114,8 @@
- [Azienda 1](./basi-di-dati-2/azienda-1.md)
- [Voli Aerei 1](./basi-di-dati-2/voli-aerei-1.md)
- [Università 1](./basi-di-dati-2/universita-1.md)
- [Voli Aerei 2]()
- [Accademia 1]()
- [Algoritmi II](./algoritmi-2/algoritmi.md)
- [Esercizi](./algoritmi-2/esercizi.md)

Expand Down
12 changes: 7 additions & 5 deletions book/algoritmi-2/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#![allow(dead_code)]

use std::{collections::VecDeque, vec};

fn find_cycle(graph: &[Vec<usize>], x: usize) -> Vec<usize> {
fn find_cycle(graph: &[Vec<usize>], node: usize) -> Vec<usize> {
let mut cycle: VecDeque<usize> = VecDeque::new();
cycle.push_back(x);
cycle.push_back(node);

let mut current = x;
let mut next = graph[x][0];
let mut current = node;
let mut next = graph[node][0];

let mut visited: Vec<bool> = vec![false; graph.len()];
visited[current] = true;
Expand Down Expand Up @@ -187,7 +189,7 @@ fn dfs_bipartito(
true
}

// G = (V, E) grafo:
// G = (V, E) grafo:

fn main() {
let g1 = vec![vec![1, 4], vec![3, 2], vec![3], vec![], vec![]];
Expand Down

0 comments on commit 9843f2c

Please sign in to comment.