一、getGenericSuperclass()和getActualTypeArguments()基本用法:import java.lang.reflect.ParameterizedType;public class TT extends TT2 {public static void main(...
分类:
其他好文 时间:
2014-10-26 22:49:01
阅读次数:
354
级别简单,用了额外的空间,不知道这个可不可以改进,最后到时ac了。public class Solution { public void merge(int A[], int m, int B[], int n) { int res[] = new int[m + n]; ...
分类:
其他好文 时间:
2014-10-26 22:48:56
阅读次数:
234
简单地用递归的方法实现了二分查找算法,适用于数组。二分查找算法的前提条件是数组本身是有序的,比如int arr[6] = {2, 3, 5, 7, 11, 13}; 1 int 2 BinarySearch(int arr[], int key, int left, int right) 3 { 4...
分类:
其他好文 时间:
2014-10-26 22:47:44
阅读次数:
232
"; } publi function stop() { echo "相机停止工作"; } } $cameral=new Camera(); $cameral->start(); $cameral->stop(); interfa...
分类:
Web程序 时间:
2014-10-26 22:47:42
阅读次数:
214
pro_name=$pro_val; } //使用__get可以获取所有的属性值 public function __get($pro_name) { if(isset($pro_name)) { return $this->pro_na...
分类:
Web程序 时间:
2014-10-26 22:46:33
阅读次数:
242
简单实现了一下插入排序的算法,针对数组进行排序。插入排序:针对一个需要排序的数组,我们把它的第一个元素当成已经排好的序列。然后我们从第二个元素开始,一个元素接着一个元素地(见第一个循环,i从1到len-1)往这个已经排好的序列当中插入“新”的元素,每次插入的时候要保证这个新的元素在这个序列中是有序的...
分类:
编程语言 时间:
2014-10-26 22:45:46
阅读次数:
199
int sendto (int s, const void *buf, int len, unsigned int flags, const struct sockaddr *to, int tolen); int recvfrom(int s, void *buf, int len, unsign...
分类:
其他好文 时间:
2014-10-26 22:44:54
阅读次数:
310
getMessage(); } } A(); ?>
分类:
Web程序 时间:
2014-10-26 22:44:35
阅读次数:
192
getMessage(); } //修改默认顶级异常处理函数 set_exception_handler("my_exception"); function a1($val) { if($val>100) { throw new Exception("val>100...
分类:
Web程序 时间:
2014-10-26 22:44:32
阅读次数:
322
Best Time to Buy and Sell Stock IIISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the...
分类:
其他好文 时间:
2014-10-26 22:43:56
阅读次数:
178