(graph: &dyn IGraph, s: usize)
| 14 | |
| 15 | impl NonRecursiveDFS { |
| 16 | pub fn new(graph: &dyn IGraph, s: usize) -> Self { |
| 17 | let mut dfs = Self { |
| 18 | marked: vec![false; graph.V()], |
| 19 | }; |
| 20 | dfs.mark(graph, s); |
| 21 | dfs |
| 22 | } |
| 23 | |
| 24 | pub fn marked(&self, v: usize) -> bool { |
| 25 | self.marked[v] |