2017年6月11日

摘要: 1 public class binarytree { 2 private Node root = null; 3 private class Node{ 4 private Value val; 5 private int key; 6 private N... 阅读全文

posted @ 2017-06-11 22:17 Wujunde 阅读(112) 评论(0) 推荐(0) 编辑

摘要: 1 public class opendressinghash { 2 private static final int INIT_CAPACITY = 4; 3 4 private int n; 5 private int m; 6 private Key[] ke... 阅读全文

posted @ 2017-06-11 22:15 Wujunde 阅读(178) 评论(0) 推荐(0) 编辑

摘要: 阅读全文

posted @ 2017-06-11 22:12 Wujunde 阅读(121) 评论(0) 推荐(0) 编辑

摘要: public class ChainingHash{ private int N; private int M; private doublylinked[] s; public ChainingHash(int M){ this.M = M; s = new doublylinked [M]; for(int i=... 阅读全文

posted @ 2017-06-11 22:08 Wujunde 阅读(149) 评论(0) 推荐(0) 编辑

摘要: h(k) = k mod m When using the division method, we usually avoid certain values of m. Forexample, m should not be a power of 2, since if m^2p, then h(k 阅读全文

posted @ 2017-06-11 01:07 Wujunde 阅读(218) 评论(0) 推荐(0) 编辑

2017年6月8日

摘要: package elementary_data_structure; import java.util.Iterator;import java.util.NoSuchElementException; public class stack<Item> implements Iterable<Ite 阅读全文

posted @ 2017-06-08 23:09 Wujunde 阅读(143) 评论(0) 推荐(0) 编辑

2017年6月7日

摘要: package sorttest; //expected and worst running time is O(n),asuming that the elements are distinct import java.util.Random; public class random_select 阅读全文

posted @ 2017-06-07 22:55 Wujunde 阅读(404) 评论(0) 推荐(0) 编辑

2017年6月6日

摘要: public class counting_sort { //O(n) it is stable(numbers with the same value appear in the output array in the same order as they do in the input //ar 阅读全文

posted @ 2017-06-06 20:46 Wujunde 阅读(108) 评论(0) 推荐(0) 编辑

2017年6月3日

摘要: The master theorem concerns recurrence relations of the form: In the application to the analysis of a recursive algorithm, the constants and function 阅读全文

posted @ 2017-06-03 23:13 Wujunde 阅读(251) 评论(0) 推荐(0) 编辑

摘要: heap:// worst: O(n*lgn) public class heap { public static void sort(int[]a){ int b[] = copy(a); int N = b.length-1; for(int k = N/2;k > 0;k--){ sink(b 阅读全文

posted @ 2017-06-03 21:56 Wujunde 阅读(139) 评论(0) 推荐(0) 编辑