2014年6月12日
摘要: 参见Mysql主从常见错误,http://hzcsky.blog.51cto.com/1560073/479476 阅读全文
posted @ 2014-06-12 17:15 真心的不懂 阅读(144) 评论(0) 推荐(0) 编辑
  2014年5月30日
摘要: http://www.cnblogs.com/stephen-liu74/archive/2012/02/18/2357783.html 阅读全文
posted @ 2014-05-30 13:31 真心的不懂 阅读(151) 评论(0) 推荐(0) 编辑
摘要: public class Fibonacci { private static Map map = new HashMap(); static{ map.put(0L, 1L); map.put(1L, 1L); } public static void main(String[] arg... 阅读全文
posted @ 2014-05-30 11:05 真心的不懂 阅读(319) 评论(0) 推荐(0) 编辑
  2014年5月26日
摘要: 我们经常使用ByteBuffer。通俗的Non-DerictedByteBuffer结构如下HeapByteBuffer extends ByteBuffer { Byte[] array; int pos,limit,cap,mark;}通俗的DirectByteBuffer结构如下Dir... 阅读全文
posted @ 2014-05-26 23:09 真心的不懂 阅读(2528) 评论(0) 推荐(1) 编辑
摘要: import java.util.ArrayList;import java.util.List;public class SubSetCount { public static void main(String[] args) { String test = new String("ABCD... 阅读全文
posted @ 2014-05-26 16:48 真心的不懂 阅读(435) 评论(0) 推荐(0) 编辑
  2013年10月5日
摘要: 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... 阅读全文
posted @ 2013-10-05 16:38 真心的不懂 阅读(400) 评论(2) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2013-10-05 16:18 真心的不懂 阅读(356) 评论(0) 推荐(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 阅读全文
posted @ 2013-10-05 15:39 真心的不懂 阅读(1641) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-10-05 15:37 真心的不懂 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 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 +... 阅读全文
posted @ 2013-10-05 15:31 真心的不懂 阅读(208) 评论(0) 推荐(0) 编辑