- 博客(411)
- 资源 (7)
- 收藏
- 关注
原创 2019.4.21
2019.4.21public Set<V> getAll(K key){ Set<V> ret = new HashSet<>(); int startIndex = hash(key.hashCode()); while(table[startIndex] != null){ ret.add(table[startIndex].getValue()); startInd
2020-06-30 23:06:03 274
原创 2019.4.20
2019.4.20@Override public void remove(K key) { int startIndex = hash(key.hashCode()); int jump = 1; while(table[startIndex] != null){ if(table[startIndex].getKey().equals(key)){ table[startIndex] =
2020-06-30 20:21:01 156
原创 2019.4.19
2019.4.19private void rehash(){ Set<Entry<K, V>> set = entrySet(); capacity <<= 1; table = new Entry[capacity]; size = 0; for(Entry<K, V> entry: set){ put(entry.getKey(), entry.ge
2020-06-30 19:58:23 309
原创 2019.4.18
2019.4.18@Override public boolean insert(T e) { if(root == null) root = createNewNode(e); else{ TreeNode<T> parent = null; TreeNode<T> current = root; while(current != null)
2020-06-30 15:03:59 187
原创 《Java语言程序设计与数据结构》编程练习答案(第二十五章)(二)
《Java语言程序设计与数据结构》编程练习答案(第二十五章)(二)英文名:Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Edition25.7//exercise 25.7 public int getNumberOfNonLeaves(){ return getNumberOfNonLeaves(root); } private int ge
2020-06-30 14:34:33 1207
原创 2019.4.17
2019.4.17public ArrayList<T> getPath(T e){ ArrayList<T> ret = new ArrayList<>(); TreeNode<T> current = getNode(e); while (!current.element.equals(root.element)){ ret.add(current.element);
2020-06-30 14:33:47 235
原创 2019.4.16
2019.4.16private class preorderIerator implements Iterator<T>{ private ArrayList<T> list = new ArrayList<>(); private int current = 0; public preorderIerator(){ preorder(); } private
2020-06-30 09:29:36 236
原创 2019.4.15
2019.4.15@Override public boolean equals(Object o){ BST<T> treeToBeCompared = (BST<T>) o; if(this.size == treeToBeCompared.size){ for(T t : treeToBeCompared){ if(!this.search(t)){
2020-06-30 09:12:23 357
原创 2019.4.14
2019.4.14private TreeNode<T> clone(TreeNode<T> root){ if(root == null){ return null; } TreeNode<T> cloneRoot = new TreeNode<>(root.element); cloneRoot.left = clone(root.left); clo
2020-06-30 08:58:42 306
原创 人智导(六):“不可测”问题的求解
人智导(六):“不可测”问题的求解动作效果的不确定性如图所示:智能体不能确切地直到其动作的效果,可能有多个结果状态表示为:[s1,…,sn]=result(s0,a)[s_1,\dots ,s_n]=result(s_0,a)[s1,…,sn]=result(s0,a)动作效果不确定,需要与环境交互在执行动作之前,智能体需要计算所用结果状态的概率P(si∣a)P(s_i|a)P(si∣a)动作的期望效用(Expected Utility):EU(a)=ΣiP(si∣a)V(s
2020-06-30 08:33:44 10664
原创 2019.4.13
2019.4.13private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root
2020-06-29 23:25:10 200
原创 2019.4.12
2019.4.12private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root
2020-06-29 23:20:51 119
原创 2019.4.11
2019.4.11private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root
2020-06-29 23:12:17 127
原创 2019.4.10
2019.4.10private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root
2020-06-29 23:09:41 114
原创 2019.4.9
2019.4.9private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root.
2020-06-29 23:04:31 144
原创 2019.4.8
2019.4.8private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root.
2020-06-29 23:00:04 112
原创 2019.4.7
2019.4.7private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root.
2020-06-29 22:55:05 122
原创 2019.4.6
2019.4.6private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root.
2020-06-29 22:49:16 107
原创 2019.4.5
2019.4.5private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root.
2020-06-29 22:43:04 179
原创 2019.4.4
20019.4.4private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1; }else if(root.left == null){ return getNumberOfLeaves(root.right); }else if(root
2020-06-29 22:37:30 116
原创 《Java语言程序设计与数据结构》编程练习答案(第二十五章)(一)
《Java语言程序设计与数据结构》编程练习答案(第二十五章)(一)英文名:Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Edition25.1public class book { public static void main(String[] args) { Scanner input = new Scanner(System.in); }
2020-06-29 22:08:37 1674
原创 2019.4.3
2019.4.3//exercise 25.6 public int getNumberOfLeaves(){ return getNumberOfLeaves(root); } private int getNumberOfLeaves(TreeNode<T> root){ if(root.left == null && root.right == null){ return 1;
2020-06-29 22:07:52 163
原创 2019.4.2
2019.4.2public void postorderUsingStack(){ postorderUsingStack(root); } private void postorderUsingStack(TreeNode<T> root){ if(root == null) return; Stack<TreeNode<T>> stack = new Stack<&g
2020-06-29 22:00:36 164
原创 2019.4.1
2019.4.1//exercise 25.4 public void preorderUsingStack(){ preorderUsingStack(root); } private void preorderUsingStack(TreeNode<T> root){ if(root == null) return; Stack<TreeNode<T>> stack =
2020-06-29 21:41:31 506
原创 2019.3.36
2019.3.36//exercise 25.3 public void inorderUsingStack(){ inorderUsingStack(root); } private void inorderUsingStack(TreeNode<T> root){ if(root == null) return; Stack<TreeNode<T>> stack = n
2020-06-29 21:31:25 135
原创 2019.3.35
2019.3.35@Override public void inorder(){ inorder(root); } protected void inorder(TreeNode<T> root){ if(root == null){ return; } inorder(root.left); System.out.print(root.element+"
2020-06-29 20:00:43 123
原创 2019.3.34
2019.3.34@Override public void inorder(){ inorder(root); } protected void inorder(TreeNode<T> root){ if(root == null){ return; } inorder(root.left); System.out.print(root.element+"
2020-06-29 19:58:29 130
原创 2019.3.33
2019.3.33@Override public void inorder(){ inorder(root); } protected void inorder(TreeNode<T> root){ if(root == null){ return; } inorder(root.left); System.out.print(root.element+"
2020-06-29 18:06:09 57744 1
原创 2019.3.32
2019.3.32@Override public boolean search(T e) { TreeNode<T> current = root; while (current != null){ if(e.compareTo(current.element) < 0){ current = current.left; } else if(
2020-06-29 17:59:36 132
原创 2019.3.31
2019.3.31@Override public default boolean isEmpty(){ return size() == 0; } @Override public default boolean contains(Object e){ return search((T) e); } @Override public default boolean add(T e){ return
2020-06-29 17:39:53 494
原创 《Java语言程序设计与数据结构》编程练习答案(第二十四章)(二)
《Java语言程序设计与数据结构》编程练习答案(第二十四章)(二)英文名:Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Edition24.13public class book { public static void main(String[] args) { Scanner input = new Scanner(System.in);
2020-06-29 17:14:07 736
原创 2019.3.30
2019.3.30public void add(T e){ if(list.isEmpty() || list.get(list.size()-1).compareTo(e) < 0){ list.add(e); } else{ for(int i=0;i<list.size();i++){ if(list.get(i).compareTo(e) > 0){
2020-06-29 17:13:54 26702
原创 2019.3.29
2019.3.29️public void add(T e){ if(list.isEmpty() || list.get(list.size()-1).compareTo(e) < 0){ list.add(e); } else{ for(int i=0;i<list.size();i++){ if(list.get(i).compareTo(e) > 0){
2020-06-29 16:59:19 20323
原创 2019.3.28
2019.3.28public void add(T e){ if(list.isEmpty() || list.get(list.size()-1).compareTo(e) < 0){ list.add(e); } else{ for(int i=0;i<list.size();i++){ if(list.get(i).compareTo(e) > 0){
2020-06-29 16:47:29 108
原创 2019.3.27
2019.3.27test.add(114514); test.add(1919810); test.add(114514); assert test.get(0) == 114514; assert test.indexOf(1919810) == 1; assert test.lastIndexOf(114514) == 2; assert test.remove(2) == 114514;
2020-06-29 15:08:53 131
原创 2019.3.26
2019.3.26class MyArrayList<T> { public MyArrayList(){ } public MyArrayList(T[] objects){ for(T o: objects){ add(o); } } public void add(T e){ } public void clear(){ } public void add(int index,
2020-06-29 15:00:24 185
原创 2019.3.25
2019.3.25class PrimeIterator{ private int limit; private int current = 2; public PrimeIterator(){ } public PrimeIterator(int limit){ this.limit = limit; } public boolean hasNext(){ return current <= limit
2020-06-29 14:43:56 2039
原创 2019.3.24
2019.3.24class PrimeIterator{ private int limit; private int current = 2; public PrimeIterator(){ } public PrimeIterator(int limit){ this.limit = limit; } public boolean hasNext(){ return current <= limit
2020-06-29 14:09:17 122
原创 《Java语言程序设计与数据结构》编程练习答案(第二十四章)(一)
《Java语言程序设计与数据结构》编程练习答案(第二十四章)(一)英文名:Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Edition24.1
2020-06-29 11:36:13 1713
原创 2019.3.23
2019.3.23private class TwoWayLinkedListIterator implements Iterator<T>{ private Node<T> current = head; public TwoWayLinkedListIterator(){} public TwoWayLinkedListIterator(int index){ for(int i=0;i<index
2020-06-29 10:17:55 95
arcanist.zip
2020-05-04
php源代码,目前最新版
2020-05-03
dafny-2.3.0.10506-x64-win.zip
2020-05-03
hsqldb-2.5.0.zip
2020-02-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人