摘要:
参见Mysql主从常见错误,http://hzcsky.blog.51cto.com/1560073/479476 阅读全文
摘要:
http://www.cnblogs.com/stephen-liu74/archive/2012/02/18/2357783.html 阅读全文
摘要:
public class Fibonacci { private static Map map = new HashMap(); static{ map.put(0L, 1L); map.put(1L, 1L); } public static void main(String[] arg... 阅读全文
摘要:
我们经常使用ByteBuffer。通俗的Non-DerictedByteBuffer结构如下HeapByteBuffer extends ByteBuffer { Byte[] array; int pos,limit,cap,mark;}通俗的DirectByteBuffer结构如下Dir... 阅读全文
摘要:
import java.util.ArrayList;import java.util.List;public class SubSetCount { public static void main(String[] args) { String test = new String("ABCD... 阅读全文
摘要:
import java.util.Collections;import java.util.HashMap;import java.util.Map;import java.util.Queue;import java.util.Stack;import java.util.Vector;import java.util.concurrent.LinkedBlockingQueue;//2叉树常用操作练习public class BinaryTreeTest { //TEST public static void main(String[] args) { BinaryTree tre... 阅读全文
摘要:
import java.util.Arrays;public class MergeSort { public static void main(String[] args) { MergeSort sort = new MergeSort(); int[] a = {2,4,3,1,0,9,5,6,3,7}; int[] r = sort.sort(a); for(int i = 0 ; i 0 ? a.length - i : b.length - j; boolean sign = a.length - i > 0 ? true : false; if(size > 0... 阅读全文
摘要:
题目:3个线程名字分别是A,B,C 现在在console上连续打印10次 ABC 。public class Test { public static void main(String[] args) { Thread a = new Thread(new Task("A",0)); Thread b = new Thread(new Task("B",1)); Thread c = new Thread(new Task("C",2)); a.start(); b.start(); c.start(); } static class 阅读全文
摘要:
public class AllSortAlgorithm { public static void main(String[] args) { char[] array = {'a','b','c'}; allsort(array,0,array.length); } private static void swap(char[] array , int i , int j){ if(i != j){ array[i]^=array[j];array[j]^=array[i];array[i]^=array[j]; } } private st 阅读全文
摘要:
public class BinarySort { public static void main(String[] args) { int[] array = {1,2,4,6,8,12,15,23}; System.out.println(binarysort(array,16)); } private static int binarysort(int[] array,int target){ int low = 0; int high = array.length - 1; while(low <= high){ int middle = ( high +... 阅读全文