feat(geektime_algo): adjust dfs params

This commit is contained in:
Caitlin Gao 2019-08-07 14:16:27 +08:00
parent 7fc0e7fc7b
commit 975a61fe6d

View File

@ -56,7 +56,12 @@ impl Graph {
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; }
visited[s as usize] = true;
if s == t {