Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def dfsInner(v: Int): Trampoline[Unit] = {
- for {
- x <- Trampoline.done(())
- _ <- Free.trampolineInstance.sequence(
- vert(v).map(x => {
- visited(v) = true
- if (!visited(x)) dfsInner(x) else Trampoline.done(())
- }).toList
- )
- } yield (scores.push(v))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement