Advertisement
Guest User

BFS

a guest
Jan 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. //private static void FindEqualNeighbourElements(int row, int col, int currentElement)
  2. //{
  3. // if (row < 0 || col < 0 || row > matrix.GetLength(0) - 1 || col > matrix.GetLength(1) - 1)
  4. // {
  5. // return;
  6. // }
  7. // if (matrix[row, col] != currentElement)
  8. // {
  9. // return;
  10. // }
  11. // if (used[row, col])
  12. // {
  13. // return;
  14. // }
  15.  
  16. // counter++;
  17. // used[row, col] = true;
  18.  
  19. // if (counter > maxCounter)
  20. // {
  21. // maxCounter = counter;
  22. // }
  23.  
  24. // FindEqualNeighbourElements(row + 1, col, matrix[row, col]);
  25. // FindEqualNeighbourElements(row, col + 1, matrix[row, col]);
  26. // FindEqualNeighbourElements(row - 1, col, matrix[row, col]);
  27. // FindEqualNeighbourElements(row, col - 1, matrix[row, col]);
  28. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement