摘要: 创建一棵二叉树: 阅读全文
posted @ 2017-11-11 13:09 误入IT界的农民工 阅读(151) 评论(0) 推荐(0) 编辑
摘要: public static void unzip1(String zipName, String temPath) throws IOException { ZipFile zip = new ZipFile(new File(zipName),Charset.forName("UTF-8")); String zipName1 = zip.getName().substring(zip... 阅读全文
posted @ 2017-11-11 13:05 误入IT界的农民工 阅读(264) 评论(0) 推荐(0) 编辑
摘要: package com.wang.sort; import java.util.Arrays; public class Sort { /** * 1.直接插入排序 * 思想:当前数与前面已经排好顺序的数进行比较,插入到合适的位置 * @param arra */ public void simpl 阅读全文
posted @ 2017-11-11 13:01 误入IT界的农民工 阅读(799) 评论(0) 推荐(0) 编辑
摘要: 例如求1235的反序5321: /** * 字符反序 * @param data * @return */ public static int getRever(int data) { int temp = data; int result = 0; //数字反序 while (temp > 0) { resu... 阅读全文
posted @ 2017-11-11 12:53 误入IT界的农民工 阅读(215) 评论(0) 推荐(0) 编辑
摘要: public static int[] twoArray(int[] a, int[] b) { int i =0; int j = 0; int k = 0; int aLen = a.length; int bLen = b.length; int[] arra = new int[aLen + bLen]; while... 阅读全文
posted @ 2017-11-11 12:51 误入IT界的农民工 阅读(367) 评论(0) 推荐(0) 编辑
摘要: /** * 非递归斐波那契数列 * @param args */ public static int getFieibolaLie(int number) { int data = 0; int n = 1; int m = 1; if (number = 2) { data += n; ... 阅读全文
posted @ 2017-11-11 12:48 误入IT界的农民工 阅读(391) 评论(0) 推荐(0) 编辑
摘要: /** * 水仙花数 */ public static void findDaffodilNumbe() { for (int i = 100; i list = getList(i); for (int j = 0; j getList(int n) { List list = new ArrayList(); list.add(n % 10); ... 阅读全文
posted @ 2017-11-11 12:46 误入IT界的农民工 阅读(281) 评论(0) 推荐(0) 编辑
摘要: /** * 找出两个数组相同的元素,并且对应的个数一样 * @param args */ public static void getSameNumberCount(String[] a, String[] b) { Map map = new HashMap(); for (int i = 0; i 1) { map.put(b[j], map.ge... 阅读全文
posted @ 2017-11-11 12:38 误入IT界的农民工 阅读(689) 评论(0) 推荐(0) 编辑