虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

DS-CD<b>m</b>A

  • hanio算法,hanoi塔的递归程序

    hanio算法,hanoi塔的递归程序,有三个柱子A,B,C在A上的n 个盘,下大上小

    标签: hanio hanoi 算法 程序

    上传时间: 2013-12-22

    上传用户:qiaoyue

  • 用于删除广义表中所有值为*的元素

    用于删除广义表中所有值为*的元素,例如删除广义表((a,b),a,(d,a))中所有a个结果是广义表((b),(d))。

    标签: 删除 元素 广义

    上传时间: 2016-07-11

    上传用户:曹云鹏

  • Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等

    Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等于m并且与m互质的正整数的个数。 phi(m) = p1^(r1-1)*(p1-1) * p2^(r2-1)*(p2-1) * …… * pn^(rn-1)*(pn-1) = m*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pn) = p1^(r1-1)*p2^(r2-1)* …… * pn^(rn-1)*phi(p1*p2*……*pn) 定理:若(a , m) = 1 则有 a^phi(m) = 1 (mod m) 即a^phi(m) - 1 整出m 在实际代码中可以用类似素数筛法求出 for (i = 1 i < MAXN i++) phi[i] = i for (i = 2 i < MAXN i++) if (phi[i] == i) { for (j = i j < MAXN j += i) { phi[j] /= i phi[j] *= i - 1 } } 容斥原理:定义phi(p) 为比p小的与p互素的数的个数 设n的素因子有p1, p2, p3, … pk 包含p1, p2…的个数为n/p1, n/p2… 包含p1*p2, p2*p3…的个数为n/(p1*p2)… phi(n) = n - sigm_[i = 1](n/pi) + sigm_[i!=j](n/(pi*pj)) - …… +- n/(p1*p2……pk) = n*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pk)

    标签: Euler lt phi 函数

    上传时间: 2014-01-10

    上传用户:wkchong

  • 汉诺塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation

    汉诺塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation eg. if n = 2 A→B A→C B→C if n = 3 A→C A→B C→B A→C B→A B→C A→C

    标签: the animation Simulate movement

    上传时间: 2017-02-11

    上传用户:waizhang

  • We analyze, both analytically and numerically, the effectiveness of cloaking an infinite cylinder f

    We analyze, both analytically and numerically, the effectiveness of cloaking an infinite cylinder from observations by electromagnetic waves in three dimensions. We show that, as truncated approximations of the ideal permittivity and permeability tensors tend towards the singular ideal cloaking fields, so that the anisotropy ratio tends to infinity, the D and B fields blow up near the cloaking surface. Since the metamaterials used to implement cloaking are based on effective medium theory, the resulting large variation in D and B will pose a challenge to the suitability of the field averaged characterization of " and 碌. We also consider cloaking with and without the SHS (softand- hard surface) lining, shown in [6] to be theoretically necessary for cloaking in the cylindrical geometry. We demonstrate numerically that cloaking is significantly improved by the SHS lining, with both the far field of the scattered wave significantly reduced and the blow up of D and B prevented.

    标签: effectiveness analytically numerically cloaking

    上传时间: 2017-03-30

    上传用户:zxc23456789

  • 工业领域串口通信速度慢是个比较突出的问题

    工业领域串口通信速度慢是个比较突出的问题, 而 F T 2 4 5 B M 能够进行 US B和并行 I / O口之间的 协议转换, 在一些条件下能够取代串口. 介绍 F T 2 4 5 B M 芯片的工作原理和功能, 并给出基于 F T2 4 5 B M 的 US B接口电路的应用设计和基于 8 9 c 5 2的汇编及 c 5 1 单片机源程序.

    标签: 工业领域 串口通信 速度 比较

    上传时间: 2017-05-27

    上传用户:kytqcool

  • 设计编程实现矩阵相乘的Strassen算法

    设计编程实现矩阵相乘的Strassen算法,具体要求: (1)矩阵阶数n由用户输入(注意n非 2k 时的处理) (2)n阶矩阵A、B调用随机函数自动生成,限定矩阵元素在0-10之间 (3)输出A、B、C=A*B (4)请在实验报告中“程序设计(方案)说明部分”写明你如何实现矩阵划分、矩阵结果合并 (5)请在源代码中对主要函数功能、变量、语句进行注释 (6)请采用结构程序设计方法或面向对象程序设计方法,对各子功能用函数实现,不要一个主函数完成所有工作

    标签: Strassen 编程实现 矩阵相乘 算法

    上传时间: 2014-01-13

    上传用户:ruixue198909

  • 本代码为编码开关代码

    本代码为编码开关代码,编码开关也就是数字音响中的 360度旋转的数字音量以及显示器上用的(单键飞梭开 关)等类似鼠标滚轮的手动计数输入设备。 我使用的编码开关为5个引脚的,其中2个引脚为按下 转轮开关(也就相当于鼠标中键)。另外3个引脚用来 检测旋转方向以及旋转步数的检测端。引脚分别为a,b,c b接地a,c分别接到P2.0和P2.1口并分别接两个10K上拉 电阻,并且a,c需要分别对地接一个104的电容,否则 因为编码开关的触点抖动会引起轻微误动作。本程序不 使用定时器,不占用中断,不使用延时代码,并对每个 细分步数进行判断,避免一切误动作,性能超级稳定。 我使用的编码器是APLS的EC11B可以参照附件的时序图 编码器控制流水灯最能说明问题,下面是以一段流水 灯来演示。

    标签: 代码 编码开关

    上传时间: 2017-07-03

    上传用户:gaojiao1999

  • 现在

    现在,有两个正整数A和B,例如A是345,B是478,现在,需要把B插入到A里, 而A有三位,所以有四个位置选择,所得结果分别是: 478345, 347845, 344785, 345478 我们通过对比可以知道,在这当中最小的一个是344785 这两个正整数长度不超过100000位,各个位均不包含数字0 现在的目标是,要找出插入后所能得到的最小的整数,输出这个整数

    标签:

    上传时间: 2014-01-05

    上传用户:jackgao

  • 《数据结构》实验报告一

    单链表的查找、插入与删除。 设计算法,实现线性结构上的单链表的产生以及元素的查找、插入与删除。具体实现要求: 1.         从键盘输入20个整数,产生不带表头的单链表,并输入结点值。 2.         从键盘输入1个整数,在单链表中查找该结点的位置。若找到,则显示“找到了”;否则,则显示“找不到”。 3.         从键盘输入2个整数,一个表示欲插入的位置i,另一个表示欲插入的数值x,将x插入在对应位置上,输出单链表所有结点值,观察输出结果。 4.         从键盘输入1个整数,表示欲删除结点的位置,输出单链表所有结点值,观察输出结果。 5.         将单链表中值重复的结点删除,使所得的结果表中个结点值均不相同,输出单链表所有结点值,观察输出结果。 6.         删除其中所有数据值为偶数的结点,输出单链表所有结点值,观察输出结果。 7.         把单链表变成带表头结点的循环链表,输出循环单链表所有结点值,观察输出结果。 8.         (★)将单链表分解成两个单链表A和B,使A链表中含有原链表中序号为奇数的元素,而B链表中含有原链表中序号为偶数的元素,且保持原来的相对顺序,分别输出单链表A和单链表B的所有结点值,观察输出结果。

    标签: C++

    上传时间: 2015-12-21

    上传用户:bdyangfan