摘要: publicinterface IBiTree<E> { //返回根节点 TreeNode<E> getRoot(); //返回fnode的左子树 TreeNode<E> getLeftChild(TreeNode<E> fnode); //返回fnode的右子树 TreeNode<E> getRi 阅读全文
posted @ 2018-08-03 20:04 带带大璞璞 阅读(499) 评论(0) 推荐(0) 编辑
摘要: //构建哈希节点类 class HashNode{ privateinte; private HashNode next; public HashNode() { this.e=0; this.next=null; } public HashNode(inte) { super(); this.e 阅读全文
posted @ 2018-07-28 17:24 带带大璞璞 阅读(299) 评论(0) 推荐(0) 编辑
摘要: publicinterface IGraph<E> { int getNumOfVertex(); //获取顶点个数 boolean insertVer(E e); //插入顶点 boolean deleteVer(E e); //删除顶点 int indexOf(E e); //获得顶点位置 E 阅读全文
posted @ 2018-07-28 12:23 带带大璞璞 阅读(577) 评论(0) 推荐(0) 编辑
摘要: //直接插入排序 publicstaticint[] insertSort(int []data) { intlen=data.length; for(inti=1;i<len;i++) { inttemp=data[i]; intj; for(j=i-1;j>=0&&data[j]>temp;j- 阅读全文
posted @ 2018-07-28 12:23 带带大璞璞 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 因此,java中的字符串引用存放在栈中,如果在编译期已经定义好,则存放在常量池中,如果在运行期间出来的对象则存储在堆中,对于通过equals方法比较相等的字符串在字符常量池中只有一个,在堆中可能有多个。 this.value=Arrays.copyOf(values, values.length); 阅读全文
posted @ 2018-07-26 12:35 带带大璞璞 阅读(1434) 评论(0) 推荐(0) 编辑
摘要: publicinterface IQueue<E> { boolean enqueue(E e); //入栈 E dequeue(); //出栈 E peek(); //去对头元素 int size(); //返回队长 boolean isEmpty(); //判断是否空队 boolean ifFu 阅读全文
posted @ 2018-07-25 19:39 带带大璞璞 阅读(799) 评论(0) 推荐(0) 编辑
摘要: publicinterface IStack <E>{ E push(E e); E pop(); E peek(); int size(); boolean empty(); } publicclass MySquenceStack <E>implements IStack<E> { privat 阅读全文
posted @ 2018-07-25 15:15 带带大璞璞 阅读(606) 评论(0) 推荐(0) 编辑
摘要: publicinterface IList<E> { boolean add(E e); boolean insert(E e,intindex); E remove(intindex); int indexof(E e); E get(intindex); int size(); void cle 阅读全文
posted @ 2018-07-24 16:57 带带大璞璞 阅读(498) 评论(0) 推荐(0) 编辑