message: feat: Implement Default for traversals
diff: @@ -41,6 +41,18 @@ pub struct Dfs<N, VM> {
  pub discovered: VM,
  }
  +impl<N, VM> Default for Dfs<N, VM>
  +where
  + VM: Default,
  +{
  + fn default() -> Self {
  + Dfs {
  + stack: Vec::new(),
  + discovered: VM::default(),
  + }
  + }
  +}
  +
  impl<N, VM> Dfs<N, VM>
  where
  N: Copy + PartialEq,
  @@ -125,6 +137,19 @@ pub struct DfsPostOrder<N, VM> {
  pub finished: VM,
  }
  +impl<N, VM> Default for DfsPostOrder<N, VM>
  +where
  + VM: Default,
  +{
  + fn default() -> Self {
  + DfsPostOrder {
  + stack: Vec::new(),
  + discovered: VM::default(),
  + finished: VM::default(),
  + }
  + }
  +}
  +
  impl<N, VM> DfsPostOrder<N, VM>
  where
  N: Copy + PartialEq,
  @@ -232,6 +257,18 @@ pub struct Bfs<N, VM> {
  pub discovered: VM,
  }
  +impl<N, VM> Default for Bfs<N, VM>
  +where
  + VM: Default,
  +{
  + fn default() -> Self {
  + Bfs {
  + stack: VecDeque::new(),
  + discovered: VM::default(),
  + }
  + }
  +}
  +
  impl<N, VM> Bfs<N, VM>
  where
  N: Copy + PartialEq,
  @@ -279,6 +316,18 @@ pub struct Topo<N, VM> {
  ordered: VM,
  }
  +impl<N, VM> Default for Topo<N, VM>
  +where
  + VM: Default,
  +{
  + fn default() -> Self {
  + Topo {
  + tovisit: Vec::new(),
  + ordered: VM::default(),
  + }
  + }
  +}
  +
  impl<N, VM> Topo<N, VM>
  where
  N: Copy + PartialEq,
  