我每次仔细听leo的《Der letzte Mohikaner(最后的莫西干人)》演奏都会出现幻觉,在潘帕斯广袤草原、在青藏高原的绝壁悬崖,在撒哈拉的无际沙漠,在亚马孙的原始森林,在太平洋荒无人烟的小岛,幻想着幻想着心情就好。
1.若将target增加到有序的数组集合nums里,得到应该插入的位置
public int findInsertPlace(List<Integer> nums, int target)
{
int length = nums.size();
if(target <= nums.get(0))
return 0;
for(int i = 0; i < length; ++i)
{
if(nums.get(i) >= target)
return i;
}
return length;
}
2.获取target在集合数组nums中的位置
public int findInterIdex(List<Integer> nums, int target){
return Collections.binarySearch(nums,target);
}
3.判断targetValue是否在集合arr中
public static boolean useLoop(List<mFraInfo> arr, int targetValue) {
for(mFraInfo s: arr){
if(s.getmFra()== targetValue)
return true;
}
return false;
}