Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. bool check(node S, bool isSecond = false) {
  2.     S.isVisited = true
  3.     for <S, P> in E {
  4.         if P.isVisited && isSecond {
  5.             return true
  6.         }
  7.         if check(P, !isSecond) {
  8.             return true
  9.         }
  10.     }
  11.     return isSecond
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement