摘要: 最最最最最最最基本的Trie词频统计应用了.package trie;import java.util.Scanner;public class Main { public static void main( String[] args ) { TrieTree tt = new... 阅读全文
posted @ 2016-01-05 15:48 hudiwei-hdw 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionEddy是个ACMer,他不仅喜欢做ACM题,而且对于Ranklist中每个人的ac数量也有一定的研究,他在无聊时经常在纸上把Ranklist上每个人的ac题目的数量摘录下来,然后从中选择一部分人(或者全部)按照ac的数量分成两组进行比较,他想使第一组中的最小a... 阅读全文
posted @ 2015-12-29 14:34 hudiwei-hdw 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionEddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如果他有2N张牌,编号为1,2,3..n,n+1,..2n。这也是最初的牌的顺序。通过一次洗牌可以把牌的序列变为n+1,1,n+2,2,n+3,3,n+4,4..2n,... 阅读全文
posted @ 2015-12-22 22:36 hudiwei-hdw 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大家的讨论后一般没有解决不了的问题,这也只有HDU ACM集训队特有的圆桌会议,有一天你也可以进来体会一下哦:),在... 阅读全文
posted @ 2015-12-21 14:39 hudiwei-hdw 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjace... 阅读全文
posted @ 2015-12-20 15:06 hudiwei-hdw 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 一道比较有意思的水题。题目The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is r... 阅读全文
posted @ 2015-12-19 00:35 hudiwei-hdw 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may comp... 阅读全文
posted @ 2015-12-18 14:25 hudiwei-hdw 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock题目:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to... 阅读全文
posted @ 2015-12-18 14:23 hudiwei-hdw 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Created byAustin Appleby,Authored byYonik Seeleypackage util.hash;/** * The MurmurHash3 algorithm was created by Austin Appleby and placed in the pub... 阅读全文
posted @ 2015-12-08 19:23 hudiwei-hdw 阅读(1927) 评论(0) 推荐(0) 编辑
摘要: Tire树,又叫字典树,主要是用来查找单词,词频统计的.老规矩,直接上代码.package tireTree;public class TireTree { TireNode root; public TireTree(TireNode root) { this.root = root; } pr... 阅读全文
posted @ 2015-11-15 00:46 hudiwei-hdw 阅读(298) 评论(0) 推荐(0) 编辑