码迷,mamicode.com
首页 >  
搜索关键字:suffix automaton    ( 461个结果
SQL或HQL预编译语句,能够防止SQL注入,但是不能处理%和_特殊字符
最近项目在做整改,将所有DAO层的直接拼接SQL字符串的代码,转换成使用预编译语句的方式。个人通过写dao层的单元测试,有以下几点收获。 dao层代码如下 //使用了预编译sql public List selectConfigBySuffix(String suffix) { String hql = "from IndvConfigModel where configKey...
分类:数据库   时间:2014-09-04 17:11:55    阅读次数:229
利用后缀数组(suffix array)求最长公共子串(longest common substring)
本文讨论了最长公共子串的的相关算法的时间复杂度,然后在后缀数组的基础上提出了一个时间复杂度为o(n^2*logn),空间复杂度为o(n)的算法。该算法虽然不及动态规划和后缀树算法的复杂度低,但其重要的优势在于可以编码简单,代码易于理解,适合快速实现。
分类:其他好文   时间:2014-09-03 16:26:16    阅读次数:309
erlang binary
matches -> 始终与最长的进行匹配match -> 始终与第一个进行匹配longest_common_prefix -> 共同的前缀的长度longest_common_suffix -> 共同的后缀的长度binary:part(>, {3,4}) == binary:part(>, {7.....
分类:其他好文   时间:2014-09-03 12:49:16    阅读次数:173
UVA - 1386 Cellular Automaton
题目:点击打开链接 题意:一个细胞自动机包含n个格子,每个格子的值都会变成它距离不超过d的所有格子的值,求最后的结果 思路:这个是循环矩阵,可以用O(n^2)的时间过掉 #include #include #include #include using namespace std; typedef long long ll; const int maxn = 505; int n,...
分类:其他好文   时间:2014-09-01 21:12:33    阅读次数:165
【POJ】3150 Cellular Automaton(矩阵乘法+特殊的技巧)
http://poj.org/problem?id=3150这题裸的矩阵很容易看出,假设d=1,n=5那么矩阵是这样的1 1 0 0 11 1 1 0 00 1 1 1 00 0 1 1 11 0 0 1 1这是n^3的,可是n#include #include #include #include ...
分类:其他好文   时间:2014-08-30 12:31:19    阅读次数:269
basename/dirname 获取文件名/路径
http://ruby-doc.org/core-2.1.2/File.html#method-c-dirname(1)basename(file_name [, suffix] ) → base_nameReturns the last component of the filename give...
分类:其他好文   时间:2014-08-28 17:58:25    阅读次数:202
18.8 suffix tree
给定一个字符串s 和 一个包含较短字符串的数组t,设计一个方法,根据t中的每一个较短的字符换,对s进行搜索。思路:基于s建立后缀树,然后在后缀树中进行查找,返回所有可能的索引值。import java.util.ArrayList;public class Question { public ...
分类:其他好文   时间:2014-08-26 17:14:26    阅读次数:270
学渣乱搞系列之后缀数组
学渣乱搞系列之后缀数组 by 狂徒归来 后缀数组,其nlogn的构造方法,比较麻烦,十几个循环,基数排序?计数排序?各种排序,各种凌乱,学渣表示鸭梨很大啊!学渣从《挑战程序设计竞赛》中偷学了一点nlog2n的构造方法。字符串后缀(Suffix)是指从字符串的某个位置开始到其末...
分类:其他好文   时间:2014-08-23 12:30:30    阅读次数:217
后缀树(Suffix Trie)子串匹配结构
Suffix Trie 又称后缀Trie或后缀树。它与Trie树的最大不同在于,后缀Trie的字符串集合是由指定字符串的后缀子串构成的。比如、完整字符串"minimize"的后缀子串组成的集合S分别如下: s1=minimize s2=inimize s3=nimize s4=imize s5=mi...
分类:其他好文   时间:2014-08-22 14:22:59    阅读次数:207
常用的工具类-CreateFileUtil,Redirect
class?CreateFileUtil?{ ?? ??public?static?String?createTempFile(String?prefix,?String?suffix,?String?dirName)?{?? ????File?tempFile?=?null;?? ????if?(dirName?==?nul...
分类:其他好文   时间:2014-08-22 13:09:40    阅读次数:293
461条   上一页 1 ... 40 41 42 43 44 ... 47 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!