Guest User

Untitled

a guest
Jan 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. bool parallelDFS(int u1, int u2) {
  2.     col[u1] = CL_GREY;
  3.    
  4.     if (isTerm1[u1] != isTerm2[u2])
  5.         return false;
  6.    
  7.     for (int c = 0; c < 26; ++c) {
  8.         int v1 = go1[u1][c];
  9.         int v2 = go2[u2][c];
  10.         if ((v1 == 0 && v2 != 0) || (v1 != 0 && v2 == 0))
  11.             return false;
  12.        
  13.         if (v1 != 0 && col[v1 - 1] == CL_WHITE) {
  14.             return parallelDFS(v1 - 1, v2 - 1);
  15.         }
  16.     }
  17.     col[u1] = CL_BLACK;
  18.     return true;
  19. }
Add Comment
Please, Sign In to add comment