题目
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
方法
题目中是找出所有的字符串由相同的字符组成,只是顺序不同。
public List anagrams(St...
分类:
其他好文 时间:
2014-06-19 10:46:45
阅读次数:
207
HashMap与HashTable1.hashMap去掉了HashTable
的contains方法,但是加上了containsValue()和containsKey()方法。2.hashTable同步的,而HashMap是非同步的,效率上比hashTable要高,HashMap不是线程安全的
,H...
分类:
其他好文 时间:
2014-06-16 10:08:43
阅读次数:
182
SSH 框架下code:
public String deleRubbishAd(){
int deleADcount = 0;
rubbishADtp = configDao.rubbishADtp();
//数据库中的广告图片集合
Map shujuku= new HashMap();
File adfile = new File("C://Program Files//A...
分类:
数据库 时间:
2014-06-15 15:55:30
阅读次数:
252
不准备实现算法先,根据21题和前辈的经验,这道题的真正考核点不在于解决这个问题,而在于拿到这个问题以后题的问题。正常的一个做法,一次扫描然后用HASHMAP进行一个统计,然后再扫描一次HASHMAP获得频率最高的数。时间是O(N)空间也是O(N)。还有一种是做排序,然后扫描一次根据下标计算可以得到频...
分类:
其他好文 时间:
2014-06-13 18:01:53
阅读次数:
421
/***@ author ViVi*@date 2014-6-11*/
Hashmap是一种非常常用的、应用广泛的数据类型,最近研究到相关的内容,就正好复习一下。希望通过仪器讨论、共同提高~1、HashMap的数据结构
要知道HashMap是什么,首先要搞清楚它的数据结构,在Java编程语言中,最....
分类:
其他好文 时间:
2014-06-12 13:35:03
阅读次数:
226
类层次关系如下:Collection├List│├LinkedList│├ArrayList│└Vector│ └Stack└SetMap├Hashtable├HashMap└WeakHashMap下面来分别介绍Collection接口
Collection是最基本的集合接口,一个Collecti....
分类:
编程语言 时间:
2014-06-12 10:01:52
阅读次数:
290
对树形结构数据的整理算法。每次做到类似的问题的时候,都很后悔上大学的时候对acm嗤之以鼻。其实现在还是有点嗤之以鼻。。。。我觉得这根本不叫算法啊,数学模型才叫算法啊。。。。求醍醐灌顶!
另外本文求更优的解法,尤其是学过acm的童鞋的批评。...
分类:
其他好文 时间:
2014-06-10 15:09:23
阅读次数:
198
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-06-08 02:12:04
阅读次数:
216