搜索资源列表
acjanchan
- 2^x mod n = 1 acm竞赛题 Give a number n, find the minimum x that satisfies 2^x mod n = 1. Input One positive integer on each line, the value of n. Output If the minimum x exists, print a line with 2^x mod n = 1. Print 2^?
jeromel
- 利用Hash技术统计单词的频度。扫描一个C源程序,用Hash表存储该程序中出现的关键字,并统计该程序中的关键字出现的频度。用线性探测法解决Hash冲突。设Hash函数为:Hash(Key)=[(Key的首字母序号)*100+(Key的尾字母序号)] Mod 41 -use statistical word frequency. Scanning a C source files, using the hash table storage procedures of the keyword s
HASH
- 扫描一个C源程序,用Hash表存储该程序中出现的关键字,并统计该程序中的关键字出现频度。用线性探测法解决Hash冲突。设Hash函数为: Hash(key)=[(key的第一个字母序号)*100+(key的最后一个字母序号)] MOD 41
Hash
- 试构造一个算法,从键盘输入一组关键字,按哈希函数H(key) = key MOD 13和链地址法处理冲突构来造哈希表,能对关键字进行查找并显示。 如(19,14,23,1,68,20,84,27,55,11,10,79,33). -Try to construct a method, a set of keywords from the keyboard, press the hash function H (key) = key MOD 13 and the address of th
HashModQuadratic12
- Hash Mod Quadratic Implementation
d
- 设定哈希函数 H(key) = key MOD 11 ( 表长=11 ),输入一组关键字序列,根据线性探测再散列解决冲突的方法建立哈希表的存储结构,显示哈希表,任意输入关键字,判断是否在哈希表中。-Set the hash function H (key) = key MOD 11 (table length = 11), enter a keyword sequence, then hash based on the linear probing method of conflict reso
RK
- 实验RK算法,即利用Hash方法和素数理论,首先定义一个Hash函数(hash (r) = r mod q),然后将模式串P和文本串T中长度为m的子串利用Hash函数转换成数值。显然只需比较那些与模式串具有相同Hash函数值的子串。 当然因为Hash冲突的存在,还要进一步进行字符串比较,但只要选择适当的素数q, Hash冲突的概率就会很小 -Experimental RK algorithm, namely the use of Hash methods and prime number
tree
- 构建树状数组,根据两点之间的路劲长度是否等于其编号差(mod n)来判断两点是否相通。-Construction of the tree array, according to the length between two points of the Road King is equal to its number difference (mod n) to determine whether two interlinked.
xiaojianzhushi
- 说明 沉默是一位小的建筑师,他喜欢他的积木,使各种建筑物。现在他又有了新的问题。他要建立建设一个大小为2*2* N的积木,但他只有一种块大小为1* 1 * 2。现在,他想知道他有多少种方法可以兴建的他的积木。 输入 有几行输入。每行输入数据集。有两个整数N和P(1<= N <=10亿,1<P <= 1,000,000),在每个测试案例。输入EOF结束。 输出 对于每个测试用例,输出一个行包含一个整数,这是他可以修建的积木数量di
prime-test
- 素数测试问题(Monte Carlo算法) 求am(mod n)的算法(m≤n) 设m的二进制表示为bkbk-1…b1b0(bk=1,且k≈log2m)。 例:m=41=101001(2),bkbk-1…b1b0=101001,(k=5)。 求am可以用下述方法:初始C←1。 -Prime number test problem ( Monte Carlo algorithm) Seek am ( MOD n ) algorithm ( M = n) A
haxibiao
- //使用哈希函数:H(k)=3*k MOD length,并采用开放定址法处理冲突。试对输入的关键字序列构造哈希表,哈希表长度为length, //求等概率情况下查找成功的平均查找长度,并设计构造哈希表的完整的算法。 -//Use the hash function: H (k) = 3* k MOD length, and open addressing treatment conflicts. The test input keyword sequence constructed h
HD1014
- seed(x+1) [seed(x) + STEP] MOD 给你STEP,MOD,看对于上式是否seed(x)结果是否包括了0到MOD-1的所有值。 如果是,输出good choice 否则bad choice-seed (x+1) [seed (x)+ STEP] MOD to you STEP, MOD, look for a formula on whether seed (x) whether the results include 0 to MOD-1 for all