public boolean isValid(int row, int col, int[] queens) {
		for (int i = 1; i < col; i++) {
			// queens should not be in the same row,
			// queens should not be placed in the duijiaoxian...
			// which means |x1-x2|==|y1-y2|
			if (queens[i] != 0
					&& (queens[i] == row || (Math.abs(i - col) == Math
							.abs(queens[i] - row))))
				return false;
		}

		return true;
	}