private void floodFill(int i, int j, int[][] graph, boolean[][] visted) {
		
		LinkedList<Pair> stack = new LinkedList<Pair>();
		int c = graph[i][j];
		stack.push(new Pair(i, j));
		visted[i][j] = true;
		while (!stack.isEmpty()) {
			Pair p = stack.pop();
			for (i = p.i - 1; i <= p.i + 1; i++) {
				for (j = p.j - 1; j <= p.j + 1; j++) {
					if (i < 0 || j < 0 || i >= height || j >= width) {
						continue;
					}
					if (!visted[i][j] && graph[i][j] == c) {
						visted[i][j] = true;
						stack.push(new Pair(i, j));
					}
				}
			}
		}
	}