使用数组来实现最大堆 堆是平衡二叉树 import Date_pacage.Array; public class MaxHeap<E extends Comparable <E>> { private Array<E> data; public MaxHeap(int capacity) { data = new Array<>(capacity); } public MaxHeap() { data = new Array<>(); } //…
转自:http://blog.takipi.com/garbage-collectors-serial-vs-parallel-vs-cms-vs-the-g1-and-whats-new-in-java-8/?utm_source=blog&utm_medium=in-post&utm_content=gcmisconceptions&utm_campaign=java The 4 Java Garbage Collectors – How the Wrong Choice Dr…
面试题18.1:编写一个函数,将两个数字相加.不得使用+或其他算数运算符. package cc150.high; public class Add { public static void main(String[] args) { // TODO 自动生成的方法存根 } public int add(int a,int b){ //将两个数字相加,不得使用+或者其他算数运算符 if(b == 0) return a; int sum = a^b; //相加,但不进位 int carry =…