如果我上课
private static int palindrome(char[] ch, int i, int j) {
// TODO Auto-generated method stub
if (i == j)
return 1;
// Base Case 2: If there are only 2 characters and both are same
if (ch[i] == ch[j] && i + 1 == j)
return 2;
// If the first and last characters match
if (ch[i] == ch[j])
return palindrome(ch, i + 1, j - 1) + 2;
// If the first and last characters do not match
return max(palindrome(ch, i, j - 1), palindrome(ch, i + 1, j));
}
如何使用代码优先方法在Name属性上设置唯一约束?