摘要: 下面是ArrayListpackage charpter3;import java.util.Iterator;import java.util.NoSuchElementException;public class MyArrayList implements Iterable { priva... 阅读全文
posted @ 2015-04-23 22:40 chuiyuan 阅读(257) 评论(0) 推荐(0)
摘要: 集合接口import java.util.Iterator;public interface Collection extends Iterable{ int size (); boolean isEmpty(); void clear (); boolean contains(AnyType x... 阅读全文
posted @ 2015-04-23 11:33 chuiyuan 阅读(516) 评论(0) 推荐(0)
摘要: 复杂度 O(lgN)使用条件:数据已经排序并在内存中。package chapter1;public class BinarySearch { public static > int binarySearch(T [] a, T x){ int low =0; int high = a.le... 阅读全文
posted @ 2015-04-23 00:00 chuiyuan 阅读(133) 评论(0) 推荐(0)