摘要: 1 import java.util.Random; 2 3 4 public class RBTree 5 { 6 7 private Node root; 8 9 10 public RBTree(int[] array) 11 { 12 for (int i : array) insert(i); 13 } 14 15 private Node search(int key, Node node) 16 { 17 if (node == nul... 阅读全文
posted @ 2012-07-11 18:47 rilley 阅读(253) 评论(1) 推荐(0) 编辑
摘要: 原帖地址 http://www.iteye.com/topic/561590 1 import java.util.Collection; 2 import java.util.Iterator; 3 import java.util.NoSuchElementException; 4 5 public class BinarySearchTree<E extends Comparable<E>> 6 { 7 8 public static void main(String[] args) 9 { 10 BinarySearchT... 阅读全文
posted @ 2012-07-11 15:39 rilley 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1 public class FibHeap 2 { 3 private FibNode min; 4 5 private int count; 6 7 private FibNode root; 8 9 10 public FibHeap() 11 { 12 root = new FibNode(); 13 root.left = root; 14 root.right = root; 15 } 16 17 /* 18 ... 阅读全文
posted @ 2012-07-11 15:36 rilley 阅读(643) 评论(1) 推荐(0) 编辑