剑指offer 第四天
11.旋转数组最小值
我的思路:二分查找
class Solution {
public int minArray(int[] numbers) {
int low=0;
int high= numbers.length-1;
while (low<high){
int pivot=low+(high-low)/2;
if (numbers[pivot] < numbers [high]){
high=pivot;
}else if( numbers[pivot] > numbers[high] ){
low=pivot+1;
}else {
high -=1;
}
}
return numbers[low];
}
}
12.矩阵中的路径(dfs不太熟练)
题解思路:dfs 不太熟
class Solution {
public boolean exist(char[][] board, String word) {
char[] words=word.toCharArray();
for (int i=0;i<board.length;i++){
for (int j=0;j<board[0].length;j++){
if (dfs(board,words,i,j,0))
return true;
}
}
return false;
}
boolean dfs(char[][] board ,char[] word,int i,int j,int k){
if (i>=board.length || i<0 ||j>= board[0].length|| j<0||board[i][j] != word[k])
return false;
if (k == word.length - 1)
return true;
board[i][j]='\0';
boolean res = dfs(board,word,i+1,j,k+1)||dfs(board, word, i - 1, j, k + 1)||
dfs(board, word, i, j + 1, k + 1) || dfs(board, word, i , j - 1, k + 1);
board[i][j]=word[k];
return res;
}
}
数据开发验证信息
adhoc 应用explain
寻找上游数据
1.找到表
2.寻找字段,寻找上游依赖
htlhoteldb.RateCodePropertyValue中的 ,
PropertyValueInternalName,
PropertyValueExternalChineseName,
PropertyValueExternalEnglishName