posted @ 2017-06-11 22:17 Wujunde 阅读(112) 评论(0) 推荐(0) 编辑
摘要:
1 public class binarytree { 2 private Node root = null; 3 private class Node{ 4 private Value val; 5 private int key; 6 private N... 阅读全文
摘要:
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) 编辑
摘要:
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) 编辑
摘要:
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) 编辑
摘要:
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) 编辑
摘要:
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) 编辑