輸入整數n,生成1,2,3...n這n個數字任意排列組合的所有序列
上傳時間: 2020-10-18
上傳用戶:
·詳細說明:h.264 source codes , the x264 is the most effience t e. and the codes are the newst codes . you c a n compile ti using VC 文件列表: x264 ....\AUTHORS ....\build ....\
上傳時間: 2013-07-31
上傳用戶:zhang97080564
Protel99se SDK\r\n\r\nProtel向用戶提供SDK軟件包。SDK軟件包包括:服務器生成向導和Protel API及相關文檔資料。\r\n\r\n 服務器生成向導是一個運行于設計資源管理器的插入式服務器,它為用戶生成第三方EDA軟件模板的原代碼和安裝文件(.INS文件),安裝文件用于將用戶開發的第三方EDA軟件安裝在設計資源管理器平臺上。服務器生成向導可以為用戶生成兩種格式的原代碼:Delphi和C++ Builder。\r\n\r\n為方便用戶開發第三方EDA軟件,Protel向用戶
上傳時間: 2013-09-18
上傳用戶:txfyddz
裝箱問題:在裝箱問題中,有若干個容量為c 的箱子和n 個待裝載入箱子中的物品。物品i 需占 用s[i]個單元(0< s[i]≤c)。成功裝載是指能把所有物品都裝入箱子。最優裝載是指使用最 少箱子的成功裝載。 例如某運輸公司要把包裹裝入卡車中,每個包裹都有一定的重量,且每輛卡車也有其載 重限制(假設每輛卡車的載重都一樣)。在卡車裝載問題中,希望用最少的卡車來裝載包裹。 此問題可看作裝箱問題。卡車對應于箱子,包裹對應于物品。 解裝箱問題的Best Fit 算法: 設avail[i]為箱子i 的可用容量。 初始時,所有箱子的可用容量為c 。 選擇物品i放入具有最小avail且容量大于s[i]的箱子中。
標簽:
上傳時間: 2015-05-22
上傳用戶:yan2267246
在通信或者其他仿真的時候,常需要產生一定區間下的分布函數,此代碼就是在c語言下實現n(0,1)_distribution
上傳時間: 2014-01-06
上傳用戶:tfyt
提供一種求解最優哈密爾頓的算法---三邊交換調整法,要求在運行jiaohuan3(三交換法)之前,給定鄰接矩陣C和節點個數N,結果路徑存放于R中。 bianquan.m文件給出了一個參數實例,可在命令窗口中輸入bianquan,得到鄰接矩陣C和節點個數N以及一個任意給出的路徑R,,回車后再輸入jiaohuan3,得到了最優解。 由于沒有經過大量的實驗,又是近似算法,對于網絡比較復雜的情況,可以嘗試多運行幾次jiaohuan3,看是否能到進一步的優化結果。
上傳時間: 2013-11-30
上傳用戶:huyiming139
cost存放了一個強連通圖的邊權矩陣,作為一個實例。 可在workspace中加載 運用此算法要注意多次試驗。 bianquan.m文件給出了一個參數實例,可在命令窗口中輸入bianquan,得到鄰接矩陣C和節點個數N以及一個任意給出的路徑R,,回車后再輸入jiaohuan3,得到了最優解。 由于沒有經過大量的實驗,又是近似算法,對于網絡比較復雜的情況,可以嘗試多運行幾次jiaohuan3,看是否能到進一步的優化結果。
上傳時間: 2014-01-14
上傳用戶:qlpqlq
程序設計思路 在動態規劃中,可將一個問題的解決方案視為一系列決策的結果,要考察每個最優決策序列中是否包含一個最優子序列。所以在最短路徑問題中,假如在的第一次決策時到達了某個節點v,那么不管v 是怎樣確定的,此后選擇從v 到d 的路徑時,都必須采用最優策略。利用最優序列由最優子序列構成的結論,可得到f 的遞歸式。f ( 1 ,c) 是初始時背包問題的最優解。可使用(1)中所示公式通過遞歸或迭代來求解f ( 1 ,c)。從f (n, * )開始迭式, f (n, * )由第一個式子得出,然后由第二式遞歸計算f (i,*) ( i=n- 1,n- 2,⋯ , 2 ),最后得出f ( 1 ,c)。動態規劃方法采用最優原則( principle of optimality)來建立用于計算最優解的遞歸式。所謂最優原則即不管前面的策略如何,此后的決策必須是基于當前狀態(由上一次決策產生)的最優決策。由于對于有些問題的某些遞歸式來說并不一定能保證最優原則,因此在求解問題時有必要對它進行驗證。若不能保持最優原則,則不可應用動態規劃方法。
上傳時間: 2016-12-03
上傳用戶:kristycreasy
RSA ( Rivest Shamir Adleman )is crypthograph system that used to give a secret information and digital signature . Its security based on Integer Factorization Problem (IFP). RSA uses an asymetric key. RSA was created by Rivest, Shamir, and Adleman in 1977. Every user have a pair of key, public key and private key. Public key (e) . You may choose any number for e with these requirements, 1< e <Æ (n), where Æ (n)= (p-1) (q-1) ( p and q are first-rate), gcd (e,Æ (n))=1 (gcd= greatest common divisor). Private key (d). d=(1/e) mod(Æ (n)) Encyption (C) . C=Mª mod(n), a = e (public key), n=pq Descryption (D) . D=C° mod(n), o = d (private key
標簽: crypthograph information Adleman Rivest
上傳時間: 2017-09-01
上傳用戶:chfanjiang
#include<stdio.h> #define TREEMAX 100 typedef struct BT { char data; BT *lchild; BT *rchild; }BT; BT *CreateTree(); void Preorder(BT *T); void Postorder(BT *T); void Inorder(BT *T); void Leafnum(BT *T); void Nodenum(BT *T); int TreeDepth(BT *T); int count=0; void main() { BT *T=NULL; char ch1,ch2,a; ch1='y'; while(ch1=='y'||ch1=='y') { printf("\n"); printf("\n\t\t 二叉樹子系統"); printf("\n\t\t*****************************************"); printf("\n\t\t 1---------建二叉樹 "); printf("\n\t\t 2---------先序遍歷 "); printf("\n\t\t 3---------中序遍歷 "); printf("\n\t\t 4---------后序遍歷 "); printf("\n\t\t 5---------求葉子數 "); printf("\n\t\t 6---------求結點數 "); printf("\n\t\t 7---------求樹深度 "); printf("\n\t\t 0---------返 回 "); printf("\n\t\t*****************************************"); printf("\n\t\t 請選擇菜單號 (0--7)"); scanf("%c",&ch2); getchar(); printf("\n"); switch(ch2) { case'1': printf("\n\t\t請按先序序列輸入二叉樹的結點:\n"); printf("\n\t\t說明:輸入結點(‘0’代表后繼結點為空)后按回車。\n"); printf("\n\t\t請輸入根結點:"); T=CreateTree(); printf("\n\t\t二叉樹成功建立!\n");break; case'2': printf("\n\t\t該二叉樹的先序遍歷序列為:"); Preorder(T);break; case'3': printf("\n\t\t該二叉樹的中序遍歷序列為:"); Inorder(T);break; case'4': printf("\n\t\t該二叉樹的后序遍歷序列為:"); Postorder(T);break; case'5': count=0;Leafnum(T); printf("\n\t\t該二叉樹有%d個葉子。\n",count);break; case'6': count=0;Nodenum(T); printf("\n\t\t該二叉樹總共有%d個結點。\n",count);break; case'7': printf("\n\t\t該樹的深度為:%d",TreeDepth(T)); break; case'0': ch1='n';break; default: printf("\n\t\t***請注意:輸入有誤!***"); } if(ch2!='0') { printf("\n\n\t\t按【Enter】鍵繼續,按任意鍵返回主菜單!\n"); a=getchar(); if(a!='\xA') { getchar(); ch1='n'; } } } } BT *CreateTree() { BT *t; char x; scanf("%c",&x); getchar(); if(x=='0') t=NULL; else { t=new BT; t->data=x; printf("\n\t\t請輸入%c結點的左子結點:",t->data); t->lchild=CreateTree(); printf("\n\t\t請輸入%c結點的右子結點:",t->data); t->rchild=CreateTree(); } return t; } void Preorder(BT *T) { if(T) { printf("%3c",T->data); Preorder(T->lchild); Preorder(T->rchild); } } void Inorder(BT *T) { if(T) { Inorder(T->lchild); printf("%3c",T->data); Inorder(T->rchild); } } void Postorder(BT *T) { if(T) { Postorder(T->lchild); Postorder(T->rchild); printf("%3c",T->data); } } void Leafnum(BT *T) { if(T) { if(T->lchild==NULL&&T->rchild==NULL) count++; Leafnum(T->lchild); Leafnum(T->rchild); } } void Nodenum(BT *T) { if(T) { count++; Nodenum(T->lchild); Nodenum(T->rchild); } } int TreeDepth(BT *T) { int ldep,rdep; if(T==NULL) return 0; else { ldep=TreeDepth(T->lchild); rdep=TreeDepth(T->rchild); if(ldep>rdep) return ldep+1; else return rdep+1; } }
上傳時間: 2020-06-11
上傳用戶:ccccy