自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 资源 (2)
  • 收藏
  • 关注

转载 ExecutorService线程池的用法

在Java5之后,并发线程这块发生了根本的变化,最重要的莫过于新的启动、调度、管理线程的一大堆API了。在Java5以后,通过 Executor来启动线程比用Thread的start()更好。在新特征中,可以很容易控制线程的启动、执行和关闭过程,还可以很容易使用线程池的特性。一、创建任务任务就是一个实现了Runnable接口的类。创建的时候实run方法即可。二、执行

2016-10-28 15:04:03 322

原创 编程之美3.7队列中取最大值操作问题Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package chart_3

2016-08-09 16:36:04 835

原创 编程之美3.5最短摘要的生成Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package chart_3

2016-08-08 16:00:10 557

原创 编程之美3.2电话号码对应英语单词 java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package chart_3

2016-08-05 12:17:40 569

原创 编程之美3.1字符串一位包含的问题Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package chart_3

2016-08-05 10:35:31 465

原创 编程之美2.17数组循环移位Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-07-02 10:40:41 447

原创 编程之美2.16求数组中最长递增子序列Java版

解法三还没写/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package

2016-07-01 21:21:22 2980 2

原创 编程之美2.15子数组之和的最大值(二维)Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-30 12:03:05 476

原创 编程之美2.14求数组的子数组之和的最大值Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-26 17:41:06 607

原创 编程之美2.13子数组的最大乘积Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-24 12:10:54 415

原创 编程之美2.12快速寻找满足条件的两个数及扩展问题Java版

面试中很多题目都是给定一个数组,要求返还两个下标的。高效解法:先排序,然后在一个循环体力利用两个变量进行反向的遍历,并且这两个变量遍历的方向是不变的,从而保证遍历算法的时间复杂度。/* * To change this license header, choose License Headers in Project Properties. * To change this templat

2016-06-23 16:22:50 636

原创 编程之美2.11寻找最近的点对Java版二

二维的分治思想 public static void main(String[] args) {  double[][] arry2 = new double[][]{{10, 10}, {8, 2}, {5, 6}, {3, 3}, {12, 8}, {9, 10}};        List list2 = Arrays.asList(arry2); //解

2016-06-22 16:50:11 455

原创 编程之美2.11寻找最近点对Java版一

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-21 23:16:52 926

原创 编程之美2.10寻找数组中的最大值和最小值扩展问题Java版

可以用分治的思想,每次返回最大的前两个值,最后比较返回的四个值,从中找出第二大的 public static void main(String[] args) { //扩展问题 用分治的思想 int[] num2 = searchSecondMax2(arry,0,arry.length-1); System.out.println("数

2016-06-21 18:26:02 426

原创 编程之美2.10寻找数组中的最大值和最小值Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-20 17:46:11 1371

原创 编程之美2.9斐波那契数列

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-18 22:38:32 484

原创 编程之美2.7最大公约数问题Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-14 17:26:44 320

原创 编程之美2.6精确表达浮点数Java版

程序很简单,还没有约分/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */pack

2016-06-13 18:03:33 369

原创 编程之美2.5寻找最大的K个数 解法二 Java版

先实现了一下快速排序,代码就不贴了,网上可以找到不错的思路跟书上的解法二伪代码一样/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and ope

2016-06-09 17:48:00 380

原创 编程之美2.41的数目Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-09 10:39:27 323

转载 编程之美2.3寻找发帖"水王"

一开始没太懂是什么意思,从网上找了一段,感觉解释的不错点击打开链接思路:把一个问题转化为规模较小的问题。分治、递推、贪心

2016-06-06 12:08:11 305

原创 编程之美2.2不要被阶乘吓倒Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Test;

2016-06-04 18:38:26 428

原创 编程之美2.1求二进制数中1的个数及扩展问题Java版

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */packag

2016-06-03 20:28:12 315

原创 编程之美1.1624点游戏解法一java版

书中给出的第一种解法的java版根据给的思路可以得出是否能算出24的结论,但是没办法输出表达式值得注意的地方:1.将两个取出来的数从原数组中去掉,代码中采用的方法很巧妙,用数组后面的值和新计算出的值来代替,这样做的好处是还原数组也很简单                                 2.输出表达式的地方还没想出怎么解决扩展问题一:3,3,8,8程序给出的结论是fa

2016-06-01 13:43:15 303

原创 编程之美1.11NIM(1)一排石头游戏

解决问题的思路:当题目中有“N”出现时,可以从假设N=1开始,逐步掌握规律扩展问题1:若规定最后取光石头的人输,先取者是否有必胜策略当N=1时,必输当N=2时,必胜当N=3时,1,2,3  先取1,2或者先取2,3,有必胜策略当N=4时,1,2,3,4  无论怎样取,对手不放水,先取者输,无必胜策略当N=5时,1,2,3,4,5 ,先取5,转换为N=4时的情况,先取

2016-06-01 09:50:29 431

原创 编程之美1.15构造数独---置换法java版

脑筋急转弯一样的东西。。。/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */pa

2016-05-31 21:43:37 438

原创 编程之美1.15构造数独-----回溯法java版

完全根据书上给的思路用java写了一下假如程序进行到(1,7)时,可取的值只有一个list:4;在(1,7)的位置填上4,进行到(1,8),这是list=null,回溯到(1,7),list:4,进行到(1,8),list=null,回溯到(1,7).....就会这样一直死循环下去,这时应当回溯到(1,6)再向下继续进行,添加了一个回溯次数标记位pro_num(1,7) list:4 pro_nu

2016-05-31 19:41:50 461

原创 编程之美1.14连连看游戏设计-----广度优先算法Java版

代码从网上找的,稍微改了改。第一遍学习先学到这些吧public class BFS { public static class Queue { public int Depth; public int Dot; Queue() { Depth = -1; Dot = -1;

2016-05-31 09:28:07 978

原创 编程之美 NIM3 两堆石头的游戏 解法一Java版

public class NewClass {      static String nim(int x,int y){          if(x==y){              return "我先取,我必赢";          }          if(x>y){              int a =x;              x=y;

2016-05-24 11:27:46 614

antlr-2.7.6rc1.jar 开发用的jar包

antlr-2.7.6rc1.jar 开发用的jar包

2012-05-21

antlr.jar 开发资源

antlr.jar 觉得资源不是特别好找,传上来分享给大家

2012-05-21

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除