-
一个求解Josephus问题的函数
#include
#include
#define NULL 0
#include
typedef struct Lnode
{
int data;
struct Lnode *next;
}Josephus;
void CreateList(Josephus*&L,int n)//建立循环链表
{
int i;
Josephus *p,*s;
s=(Josephus*)malloc(sizeof(Josephus));
s->data=1;
L=p=s;
for(i=2;idata=i;
p->next=s;
p=s;
}
p->next=L;
}
void DeleteList(Josephus*&L,Josephus*p,Josephus*q)
{
q->next=p->next;
free(p);
}
void Josephus1(Josephus*&L,int s,int m)
- 2022-01-27 23:12:59下载
- 积分:1
-
快速 RSA 密码体制实现使用中国剩余定理
/ / RSATestFast: 测试快速 RSA 实现
导入 java.math.* ; / / 为 BigInteger
导入 java.util.* ; / / 为随机
公共类 RSATestFast {
公共静态 void elapsedTime (长开始时间) {
长时间停止时间 = System.currentTimeMillis() ;
双 elapsedTime = ((双)(stopTime-startTime)) / 1000.0 ;
System.out.println ("已用时间:"+ elapsedTime +"秒") ;
}
公共静态 void main (字符串 [] args) {
随机 rnd = 新 Random() ;
BigInteger m、 m1、 m2、 m3、 c、 s,s1 ;
RSAPrivateKeyFast 爱丽丝 = 新 RSAPrivateKeyFast (1024,rnd,"爱丽丝") ;
RSAPrivateKeyFast bob = 新 RSAPrivateKeyFast (1024,rnd,"鲍勃 ") ;
m = 新 BigInteger (
"1234567890987654321012345678909876543210"+
"1234567890987654321012345678909876543210"+
"1234567890987654321012345678909876543210"+
"1234567890987654321012345678909876543210"+
"1234567890987654321012345678909876543210"+
"1234567890987654321012345678909876543210") ;
System.out.println
- 2022-05-29 11:03:37下载
- 积分:1
-
Apria算法的实现
利用C++编写的Apriori算法,可以运行,结果正确。可以挖掘频繁项集以及生成关联规则结果。算法易懂,是一份不错的学习资料。
- 2022-07-08 16:00:02下载
- 积分:1
-
MULLER s algorithm Muller classical algorithm
muller s algorithm 穆勒算法 经典-MULLER s algorithm Muller classical algorithm
- 2022-03-24 18:14:01下载
- 积分:1
-
判断一点是否在多边形内
本程序判断一点是否在任意多边形内,任意多边形要求是各边不能相互交叉。
- 2022-12-09 01:10:03下载
- 积分:1
-
斗地主c语言版游戏开发代码
c语言版斗地主程序包括如何洗牌、发牌、排序、出牌、胜负的算法
- 2022-06-21 07:18:43下载
- 积分:1
-
利用CRC
利用CRC-32检测程序的完整性-The use of CRC-32 testing the integrity of the proceedings
- 2022-10-21 01:40:03下载
- 积分:1
-
介绍JPEG的原理和实现,可以做为新手的基础教材使用,会有很大的启发!...
介绍JPEG的原理和实现,可以做为新手的基础教材使用,会有很大的启发!-JPEG introduced the theory and implementation can be used as the basis for teaching novice to use, there will be a great inspiration!
- 2022-02-16 06:24:44下载
- 积分:1
-
读取影像
本代码可提供用户快速,完整读取摄影测量中需要的影像数据,包括img,tiff的格式,1G的数据量最快可达到1分钟读取完成,用户可根据路径选择数据进行读取。img和tiff是摄影测量和地理信息系统专业常用的数据格式,大量的卫星影像,近景影像都涵盖这些数据结构,所以用处很大。
- 2022-01-30 14:25:06下载
- 积分:1
-
VB实现Floyd算法
VB实现Floyd算法-VB Floyd Algorithm
- 2022-03-03 23:22:55下载
- 积分:1