- 博客(4)
- 资源 (18)
- 收藏
- 关注
原创 寻找N个元素中最大的K个元素解法
问题: 给定N个元素,寻找N个元素中最大的K个元素?具体解法的算法思想就不详细解答了,详见《编程之美》第140页,下面给出几种解法的Java代码:解法一:小顶堆原理/** * 描述: 使用小顶堆来找出n个元素中,最大的k个;结果存放在[1...k],第0个元素位置不用; * * @param array * @param k */ public static >
2013-08-30 11:01:13 1682
转载 正则表达式详细讲解
看到一篇讲得非常不错的正则表达式文章,摘录下;原文地址:http://www.regexlab.com/zh/regref.htm引言 正则表达式(regular expression)就是用一个“字符串”来描述一个特征,然后去验证另一个“字符串”是否符合这个特征。比如 表达式“ab+” 描述的特征是“一个 'a' 和 任意个 'b' ”,那么 'ab', 'ab
2013-08-21 11:02:34 1444
原创 java volatile应用之 AtomicInteger
通过前一篇文章《Java Volatile》我们知道,volatile修饰的变量,线程不进行缓存,而是直接访问,但是要想保证多线程访问该变量时,线程安全,只有满足条件:操作是原子;上篇中的i++,就是例子,他不是一个原子操作,所以不能保证多线程同时访问变量时,值的正确性;本篇文章主要介绍 AtomicInteger的提供的访问方法和为什么它没有使用synchronized关键字也能
2013-08-14 10:03:47 1705
转载 MongoDB : Aggregation mongo聚合操作详细说明
This page last changed on Feb 02, 2012 by dwight. Aggregation FrameworkCountDistinctGroupExamplesUsing Group from Various LanguagesMap/ReduceSee AlsoMongo includes utility functions
2013-08-02 09:55:30 3456
HelloWorld WebService Server
2012-11-01
Extjs exporter
2012-08-17
FlashPaper2.2 绿色版
2012-07-10
Android应用开发详解.pdf
2012-05-28
深入浅出EXTJS第2版.pdf part3(共三部分)
2011-12-08
深入浅出EXTJS第2版.pdf part1(共三部分)
2011-12-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人