码迷,mamicode.com
首页 >  
搜索关键字:sdbm hash    ( 10452个结果
感知哈希算法
”感知哈希算法”(Perceptual hash algorithm),它的作用是对每张图片生成一个”指纹”(fingerprint)字符串,然后比较不同图片的指纹。结果越接近,就说明图片越相似。优点:简单快速,不受图片大小缩放的影响。缺点:图片的内容不能更改。主要用途:根据缩略图找出原图,搜索.....
分类:其他好文   时间:2014-08-29 17:39:28    阅读次数:239
Hash表
Hash表 Hash表也称散列表,也有直接译作哈希表,Hash表是一种特殊的数据结构,它同数组、链表以及二叉排序树等相比较有很明显的区别,它能够快速定位到想要查找的记录,而不是与表中存在的记录的关键字进行比较来进行查找。这个源于Hash表设计的特殊性,它采用了函数映射的思想将记录的存储位置与记录.....
分类:其他好文   时间:2014-08-29 13:01:07    阅读次数:208
单向散列算法运算速度实测
测试环境:CentOS 6.4 X86_64位 VMWare虚拟机 1G RAM (物理主机CPU i7-3770 3.4GHz)测试代码(使用openssl的hash库):#include #include #include #include #include #include using nam...
分类:其他好文   时间:2014-08-28 12:55:09    阅读次数:320
hash function 3种方法 1不好 2一般 3好
1. h(k) = k mod m its is really bad in thepractical. if m = even and k is all even....( m is size of hash table, modulo['m?djul?u)2. multiplication m....
分类:其他好文   时间:2014-08-28 07:24:49    阅读次数:221
HDOJ 4821 String
字符串hash String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 697    Accepted Submission(s): 190 Problem Description Give...
分类:其他好文   时间:2014-08-28 02:05:28    阅读次数:245
POJ 1840 Eqs Hash + 中途相遇法
把等式分成两拨算用中途相遇法就好了。不过要注意的是这里不能用map,会超时,要自己手写hash,我重载了[]操作符之后用起来和map差不多,很随意#include #include #include #include #include #include #include #include #incl...
分类:其他好文   时间:2014-08-27 21:56:58    阅读次数:295
43. Merge Sorted Array && LRU Cache
思想:因为 A 很大, 所以从最大值开始插入, 即从 A 的 m+n 位置开始插入数据。避免了冗余的移动。 思想: 1. 由于要 O(1) 时间确定某 key 是不是在 Cache 中,所以用 Hash_map (), 从而能够O(1)找到结点地址,返回对应的 value。 2. 由...
分类:其他好文   时间:2014-08-27 21:43:08    阅读次数:191
poj 3690 Constellations 矩阵的hash
给定一个n*m矩阵和t个p*q的矩阵,求这t个矩阵有多少个是n*m的子矩阵。 矩阵都是01矩阵,只有'0' '*' 矩阵的hash,先将每行q列hash,得到一个新矩阵,然后再每列p行hash 【注意行列hash时候取的magic数不能一样,不然很容易冲突,会WA,最好取2个素数】 这样原矩阵的每个子矩阵都由一个数字代替了,之后用map判断就够了。 注意:不能事先将原矩阵的所有子矩阵h...
分类:其他好文   时间:2014-08-27 20:37:28    阅读次数:211
【COGS & USACO Training】710. 命名那个数字(hash+水题+dfs)
http://cojs.tk/cogs/problem/problem.php?pid=710近日开始刷水。。。此题我为了练一下hash。。。但是hash跑得比暴力还慢。。不言而喻。。。#include #include #include #include #include #include #in...
分类:其他好文   时间:2014-08-27 14:39:08    阅读次数:208
【BZOJ】1054: [HAOI2008]移动玩具(bfs+hash)
http://www.lydsy.com/JudgeOnline/problem.php?id=1054一开始我还以为要双向广搜。。。。但是很水的数据,不需要了。直接bfs+hash判重即可。#include #include #include #include #include #include ...
分类:移动开发   时间:2014-08-27 12:51:28    阅读次数:258
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!