1 #include 2 #include 3 //递归算法 4 int recursion(int a,int b) 5 { 6 int tem = 1; 7 if(b==0)return 1; 8 else if(b==1)return a; 9 tem =...
分类:
其他好文 时间:
2015-05-13 09:56:55
阅读次数:
130
8 Recursion8.11 recursive templates8.12 variations on the basic templates8.13 trees and car/cdr recursion8.14 helping functions8 Recursion(defun fact ...
分类:
其他好文 时间:
2015-05-10 06:15:58
阅读次数:
132
算法导论上说分治法解决一个数的n次方,它的复杂度为logn;而用连乘的复度n;#includeusing namespace std;int recursion(int x,int n){ if(n==1){ return x; }else { if(n%2==0){//n为偶数 int r...
分类:
其他好文 时间:
2015-05-05 14:18:06
阅读次数:
94
关于尾递归 ,使用Scala的两个例子展示尾递归的定义和简单实现。例子比较求最大公约数的函数def gcd(a: Int, b: Int): Int =
if (b == 0) a else gcd(b, a % b)计算的展开是尾递归的,gcd(14, 21)
-> if (21 == 0) 14 else gcd(21, 14 % 21)
-> if (false) 14 else gcd(...
分类:
其他好文 时间:
2015-04-29 23:30:49
阅读次数:
178
初学,本文只记录自己对DNS的一些理解,及其在linux上的实现。本文的实验环境是CentOS6.6,使用的bind版本为9.8.2DNS:DomainNameSystem,因特网上主机名和ip地址相互映射的数据库系统。因特网上主机之间的通信是通过ip地址实现的,而人通常只记忆某网站的网址,网址和ip之间的转..
分类:
其他好文 时间:
2015-04-29 15:22:13
阅读次数:
166
1 using System; 2 using System.Windows.Forms; 3 4 namespace DemoCore 5 { 6 public partial class Recursion : Form 7 { 8 public Recurs...
分类:
编程语言 时间:
2015-04-28 17:56:29
阅读次数:
133
Typical tree recursion works. The key is: ANY node can be treated as the root, since it is about edge, not about node. This simplifies things a lot.#i...
分类:
其他好文 时间:
2015-04-27 14:59:09
阅读次数:
120
友情提示:文中实验平台vmware10+Centos6.6X86_64,涉及的命令只为实现工作模型,不做为生产服务器配置依据。内容概括:1.DNS的工作模型2.DNS正反解析实现3.DNS主从同步一.DNS细微知识点1.1)DNS:DomainNameService,是个应用层协议,做域名与IP地址之间互相解析。使用UDP53做DN..
分类:
其他好文 时间:
2015-04-24 16:37:54
阅读次数:
202
本节以前面主、从DNS为实验环境,讲解DNSacl、view、日志系统相关使用一、配置DNSacl访问控制列表acl定义格式:aclstring{address_match_element;...};常用几钟类型格式:allow-transfer{};允许做区域传送主机allow-query{};允许做查询限定allow-recursion{};允许做递归查询列表,..
分类:
系统相关 时间:
2015-04-23 00:14:45
阅读次数:
277
所谓递归,是指程序调用自身,当然,递归不会无休止地调用下去,它必然有一个出口,当满足条件时程序也就结束了,不然的话,那就是死循环了。看下面这个类,有几个递归方法,看了之后肯定会对你学习递归很有帮助的。/**递归类Recursion的定义*/public class Recursion{//递归方法D...
分类:
编程语言 时间:
2015-04-22 17:48:56
阅读次数:
128