feat(geektime_algo): adjust dfs params
This commit is contained in:
parent
7fc0e7fc7b
commit
975a61fe6d
@ -56,7 +56,12 @@ impl Graph {
|
|||||||
self.draw(&prev, s, t);
|
self.draw(&prev, s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn recur_dfs(&self, s: i32, t: i32, visited: &mut Vec<bool>, prev: &mut Vec<i32>, found: &mut bool) {
|
fn recur_dfs(&self,
|
||||||
|
s: i32,
|
||||||
|
t: i32,
|
||||||
|
visited: &mut Vec<bool>,
|
||||||
|
prev: &mut Vec<i32>,
|
||||||
|
found: &mut bool) {
|
||||||
if *found == true { return; }
|
if *found == true { return; }
|
||||||
visited[s as usize] = true;
|
visited[s as usize] = true;
|
||||||
if s == t {
|
if s == t {
|
||||||
|
Loading…
Reference in New Issue
Block a user